Fix IMAP PARSE reponse matching. This should get rid of retrival errors
[squirrelmail.git] / functions / imap_search.php
index da7e783811303cb8e8ac75ae6a2c2ef13069ad20..858e3beebe980a82510ccadfa47a1b58b13f144a 100644 (file)
@@ -19,8 +19,8 @@ require_once('../functions/mime.php');
 
 function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color, $search_position = '', $search_all, $count_all) {
 
-    global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order;
-    global $pos;
+    global $msgs, $message_highlight_list, $squirrelmail_language, $languages, $index_order,
+           $pos;
 
     $pos = $search_position;
 
@@ -42,7 +42,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
             $search_string = '';
     $count = count($multi_search);
             for ($x=0;$x<$count;$x++) {
-                       trim($multi_search[$x]);
+                trim($multi_search[$x]);
                 $search_string = $search_string . ' ' . $search_where . ' "' . $multi_search[$x] . '"';
             }
     }
@@ -54,7 +54,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
         $languages[$squirrelmail_language]['CHARSET']) {
         $ss = "SEARCH CHARSET ".$languages[$squirrelmail_language]['CHARSET']." ALL $search_string";
     } else {
-        $ss .= "SEARCH ALL $search_string\"";
+        $ss .= "SEARCH ALL $search_string";
     }
     /* Read Data Back From IMAP */
     $readin = sqimap_run_command ($imapConnection, $ss, true, $result, $message);