summaryrefslogtreecommitdiff
path: root/program/include/rcube_imap.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcube_imap.php')
-rw-r--r--program/include/rcube_imap.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 66b5c4bd6..ebf31d578 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') {
@@ -3291,11 +3297,8 @@ class rcube_imap extends rcube_storage
}
// Get folder rights (MYRIGHTS)
- if ($acl && !$options['noselect']) {
- // skip shared roots
- if (!$options['is_root'] || $options['namespace'] == 'personal') {
- $options['rights'] = (array)$this->my_rights($folder);
- }
+ if ($acl && ($rights = $this->my_rights($folder))) {
+ $options['rights'] = $rights;
}
// Set 'norename' flag