This makes filters work with charsets other than us-ascii (as per RFC 2060).
authorgraf25 <graf25@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 5 Apr 2002 04:34:38 +0000 (04:34 +0000)
committergraf25 <graf25@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 5 Apr 2002 04:34:38 +0000 (04:34 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2681 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/filters/filters.php

index 6257cd9175d9766c3de05874063975d33a32f886..a16637fccf8bc68006d44afb3114372f27929d56 100644 (file)
@@ -324,9 +324,18 @@ function user_filters($imap_stream) {
 }
 
 function filter_search_and_delete($imap, $where, $what, $where_to) {
-    // Don't mess with the " characters on this fputs line!
-    fputs ($imap, 'a001 SEARCH ALL ' . $where . ' "' . addslashes($what) .
-        "\"\r\n");
+    global $languages, $squirrelmail_language;
+    if (isset($languages[$squirrelmail_language]['CHARSET']) &&
+        $languages[$squirrelmail_language]['CHARSET']) {
+        $search_str = "SEARCH CHARSET "
+            . strtoupper($languages[$squirrelmail_language]['CHARSET']) 
+            . " ALL ";
+    } else {
+        $search_str = "SEARCH CHARSET US-ASCII ALL ";
+    }
+    $search_str .= $where . ' {' . strlen($what) . "}\r\n" . $what . "\r\n";
+    
+    fputs ($imap, $search_str);
     $read = filters_sqimap_read_data ($imap, 'a001', true, $response, $message);
 
     // This may have problems with EIMS due to it being goofy