Changeset 2044 in subversion
- Timestamp:
- Nov 7, 2008 9:32:16 AM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2043 r2044 5 5 ---------- 6 6 - Fix empty file sending (#1485389) 7 - Improved searching with many criterias (calling one SEARCH command) 7 8 8 9 2008/11/05 (alec) -
trunk/roundcubemail/program/include/rcube_imap.php
r2021 r2044 286 286 * @param array List of message ids or NULL if empty 287 287 */ 288 function set_search_set($subject, $str=null, $msgs=null, $charset=null )288 function set_search_set($subject, $str=null, $msgs=null, $charset=null, $sorted=null) 289 289 { 290 290 if (is_array($subject) && $str == null && $msgs == null) 291 list($subject, $str, $msgs, $charset ) = $subject;291 list($subject, $str, $msgs, $charset, $sorted) = $subject; 292 292 if ($msgs != null && !is_array($msgs)) 293 293 $msgs = split(',', $msgs); … … 901 901 { 902 902 $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox; 903 904 // have an array of criterias => execute multiple searches 905 if (is_array($criteria) && $str) 906 { 907 $results = array(); 908 foreach ($criteria as $crit) 909 if ($search_result = $this->search($mbox_name, $crit, $str, $charset)) 910 $results = array_merge($results, $search_result); 911 912 $results = array_unique($results); 913 $this->set_search_set($criteria, $str, $results, $charset); 914 return $results; 915 } 916 else if ($str && $criteria) 917 { 918 $search = (!empty($charset) ? "CHARSET $charset " : '') . sprintf("%s {%d}\r\n%s", $criteria, strlen($str), $str); 919 $results = $this->_search_index($mailbox, $search); 920 921 // try search with ISO charset (should be supported by server) 922 if (empty($results) && !empty($charset) && $charset!='ISO-8859-1') 923 $results = $this->search($mbox_name, $criteria, rcube_charset_convert($str, $charset, 'ISO-8859-1'), 'ISO-8859-1'); 924 925 $this->set_search_set($criteria, $str, $results, $charset); 926 return $results; 927 } 928 else 929 return $this->_search_index($mailbox, $criteria); 903 $search = ''; 904 905 // have an array of criterias => create search string 906 if (is_array($criteria)) 907 $search .= 'OR'; 908 909 $criteria = (array) $criteria; 910 foreach($criteria as $idx => $crit) 911 if ($str) 912 $search .= sprintf(" (%s {%d}\r\n%s)", $crit, strlen($str), $str); 913 else 914 $search .= '('. $crit .')'; 915 916 $results = $this->_search_index($mailbox, (!empty($charset) ? "CHARSET $charset " : '') . $search); 917 918 // try search with ISO charset (should be supported by server) 919 if (empty($results) && !empty($charset) && $charset!='ISO-8859-1') 920 $results = $this->search($mbox_name, $criteria, rcube_charset_convert($str, $charset, 'ISO-8859-1'), 'ISO-8859-1'); 921 922 $this->set_search_set($criteria, $str, $results, $charset); 923 return $results; 930 924 } 931 925 … … 941 935 { 942 936 $a_messages = iil_C_Search($this->conn, $mailbox, $criteria); 937 943 938 // clean message list (there might be some empty entries) 944 939 if (is_array($a_messages))
Note: See TracChangeset
for help on using the changeset viewer.
