Thomas Bruederli
2012-09-17 8f098e8dead85b6512ac72b2d805314baec72a2f
program/include/rcube_imap.php
@@ -1434,6 +1434,12 @@
            $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 @@
        }
        $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 @@
        }
        // 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