diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-11-14 11:18:00 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-11-14 11:18:00 +0000 |
| commit | 81696db275ab1d654abb7e6042d3d9805fa8cb7b (patch) | |
| tree | 3c033994bb33392af4e492b9aa5936a2b4167a86 /roundcubemail/program/include/rcube_imap.php | |
| parent | 106f48cfbd0e3d8d635da3ca3ff92c2ea11466b5 (diff) | |
- fixes for status filter
- don't call search second time if first call returns empty (array) result
git-svn-id: https://svn.roundcube.net/trunk@2052 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index 765778a20..1617be3ad 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -288,7 +288,7 @@ class rcube_imap */ function set_search_set($str=null, $msgs=null, $charset=null, $sort_field=null) { - if ($msgs == null) + if (is_array($str) && $msgs == null) list($str, $msgs, $charset, $sort_field) = $str; if ($msgs != null && !is_array($msgs)) $msgs = split(',', $msgs); @@ -923,12 +923,16 @@ class rcube_imap */ function search($mbox_name='', $str=NULL, $charset=NULL, $sort_field=NULL) { + if (!$str) + return false; + $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; $results = $this->_search_index($mailbox, $str, $charset, $sort_field); // try search with ISO charset (should be supported by server) - if (empty($results) && !empty($charset) && $charset!='ISO-8859-1') + // only if UTF-8 search is not supported + if (empty($results) && !is_array($results) && !empty($charset) && $charset!='ISO-8859-1') { // convert strings to ISO-8859-1 if(preg_match_all('/\{([0-9]+)\}\r\n/', $str, $matches, PREG_OFFSET_CAPTURE)) |
