fixed bug with multiple terms and UW
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 12 Feb 2002 14:58:09 +0000 (14:58 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 12 Feb 2002 14:58:09 +0000 (14:58 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2424 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_search.php

index b9264008eeec6e6889d8079914afc9e00252ab35..da7e783811303cb8e8ac75ae6a2c2ef13069ad20 100644 (file)
@@ -42,12 +42,13 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
             $search_string = '';
     $count = count($multi_search);
             for ($x=0;$x<$count;$x++) {
-                $search_string = $search_string . ' ' . $search_where . ' "' . $multi_search[$x] . '" ';
+                       trim($multi_search[$x]);
+                $search_string = $search_string . ' ' . $search_where . ' "' . $multi_search[$x] . '"';
             }
     }
     $search_string = trim($search_string);
 
-    /* now use $search_string in the imap search */
+/* now use $search_string in the imap search */
 
     if (isset($languages[$squirrelmail_language]['CHARSET']) &&
         $languages[$squirrelmail_language]['CHARSET']) {
@@ -55,7 +56,6 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
     } else {
         $ss .= "SEARCH ALL $search_string\"";
     }
-
     /* Read Data Back From IMAP */
     $readin = sqimap_run_command ($imapConnection, $ss, true, $result, $message);
     if (isset($languages[$squirrelmail_language]['CHARSET']) && strtolower($result) == 'no') {