From: Michael M Slusarz Date: Mon, 26 Apr 2010 21:32:31 +0000 (-0600) Subject: Make sure we run IMAP search queries in the proper charset X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9acb719e4e9e6849c10aa8252f1727858b049616;p=horde.git Make sure we run IMAP search queries in the proper charset --- diff --git a/imp/lib/Search.php b/imp/lib/Search.php index 8d868367d..001185f8b 100644 --- a/imp/lib/Search.php +++ b/imp/lib/Search.php @@ -340,7 +340,14 @@ class IMP_Search } } - return $GLOBALS['imp_imap']->ob()->search($mailbox, $query, $opts); + /* Make sure we search in the proper charset. */ + $new_query = clone $query; + $imap_charset = $GLOBALS['imp_imap']->ob()->validSearchCharset('UTF-8') + ? 'UTF-8' + : 'US-ASCII'; + $new_query->charset($imap_charset, array('Horde_String', 'convertCharset')); + + return $GLOBALS['imp_imap']->ob()->search($mailbox, $new_query, $opts); } /**