diff options
author | Paweł Słowik <pawel.slowik@iq.pl> | 2012-09-13 14:24:01 +0200 |
---|---|---|
committer | Paweł Słowik <pawel.slowik@iq.pl> | 2012-09-13 14:24:01 +0200 |
commit | 2cdaa79dce689b2dc9ef5c7bf3dcbd9446d86c21 (patch) | |
tree | 7482d3bd9a71a9913f4e28392b09e11c519987de /program/include/rcube_imap.php | |
parent | 92a030d928246cfc5f3c0b1f2538dc1bfb4777e3 (diff) | |
parent | d7439260770eb1f70cdc5abf5df13e6c62ff3991 (diff) |
Merge branch 'master' of https://github.com/roundcube/roundcubemail
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r-- | program/include/rcube_imap.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index 66b5c4bd6..0b2f84d4f 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -1434,6 +1434,12 @@ class rcube_imap extends rcube_storage $criteria = 'UNDELETED '.$criteria; } + // unset CHARSET if criteria string is ASCII, this way + // SEARCH won't be re-sent after "unsupported charset" response + if ($charset && $charset != 'US-ASCII' && is_ascii($criteria)) { + $charset = 'US-ASCII'; + } + if ($this->threading) { $threads = $this->conn->thread($folder, $this->threading, $criteria, true, $charset); @@ -1465,7 +1471,7 @@ class rcube_imap extends rcube_storage } $messages = $this->conn->search($folder, - ($charset ? "CHARSET $charset " : '') . $criteria, true); + ($charset && $charset != 'US-ASCII' ? "CHARSET $charset " : '') . $criteria, true); // Error, try with US-ASCII (some servers may support only US-ASCII) if ($messages->is_error() && $charset && $charset != 'US-ASCII') { |