Fix so imap folder attribute comparisons are case-insensitive (#1490466)
+ make in_array_nocase() much faster for ASCII strings
| | |
| | | - Fix so *-request@ addresses in Sender: header are also ignored on reply-all (#1490452) |
| | | - Update to TinyMCE 4.1.10 (#1490405) |
| | | - Fix draft removal after a message is sent and storing sent message is disabled (#1490467) |
| | | - Fix so imap folder attribute comparisons are case-insensitive (#1490466) |
| | | |
| | | RELEASE 1.1.2 |
| | | ------------- |
| | |
| | | // skip folders in which it isn't possible to create subfolders |
| | | if (!empty($opts['skip_noinferiors'])) { |
| | | $attrs = $this->storage->folder_attributes($folder['id']); |
| | | if ($attrs && in_array('\\Noinferiors', $attrs)) { |
| | | if ($attrs && in_array_nocase('\\Noinferiors', $attrs)) { |
| | | continue; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Similar function as in_array() but case-insensitive |
| | | * Similar function as in_array() but case-insensitive with multibyte support. |
| | | * |
| | | * @param string $needle Needle value |
| | | * @param array $heystack Array to search in |
| | |
| | | */ |
| | | function in_array_nocase($needle, $haystack) |
| | | { |
| | | // use much faster method for ascii |
| | | if (is_ascii($needle)) { |
| | | foreach ((array) $haystack as $value) { |
| | | if (strcasecmp($value, $needle) === 0) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | $needle = mb_strtolower($needle); |
| | | foreach ((array)$haystack as $value) { |
| | | if ($needle === mb_strtolower($value)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | |
| | | if (is_array($a_folders) && $name == '*' && !empty($this->conn->data['LIST'])) { |
| | | foreach ($a_folders as $idx => $folder) { |
| | | if (($opts = $this->conn->data['LIST'][$folder]) |
| | | && in_array('\\NonExistent', $opts) |
| | | && in_array_nocase('\\NonExistent', $opts) |
| | | ) { |
| | | $this->conn->unsubscribe($folder); |
| | | unset($a_folders[$idx]); |
| | |
| | | if ($subscription) { |
| | | // It's possible we already called LIST command, check LIST data |
| | | if (!empty($this->conn->data['LIST']) && !empty($this->conn->data['LIST'][$folder]) |
| | | && in_array('\\Subscribed', $this->conn->data['LIST'][$folder]) |
| | | && in_array_nocase('\\Subscribed', $this->conn->data['LIST'][$folder]) |
| | | ) { |
| | | $a_folders = array($folder); |
| | | } |