preg_match('/iso-8859-/'.. covered all iso-8859 charsets (iso-8859-1,
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jul 2003 09:13:29 +0000 (09:13 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jul 2003 09:13:29 +0000 (09:13 +0000)
iso-8859-2, iso-8859-13 etc). stristr does not do that.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5436 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_utf7_local.php

index c2a9ce8b7f2fb401922e2f9192ebeb46e7d1aefd..ecaa7ca3f03a2c9d5f0a0c20af80c29dd017d061 100644 (file)
@@ -16,7 +16,7 @@ function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default
   // Allows mbstring functions only with iso-8859-*, utf-8 and 
   // iso-2022-jp (Japanese)
   // koi8-r and gb2312 can be added only in php 4.3+
-  if ( stristr('iso-8859-',$default_charset) ||
+  if ( stristr('iso-8859-',substr($default_charset,0,9)) ||
        stristr('utf-8',$default_charset) || 
        stristr('iso-2022-jp',$default_charset) ) {
     if (function_exists('mb_convert_encoding')) {