Repair my mistake : wrong arguments order for stristr (still not used to php's order :(
[squirrelmail.git] / functions / imap_utf7_local.php
index ecaa7ca3f03a2c9d5f0a0c20af80c29dd017d061..3435f48f06c566b39558e1249d73f8465984bc09 100644 (file)
@@ -16,9 +16,9 @@ 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-',substr($default_charset,0,9)) ||
-       stristr('utf-8',$default_charset) || 
-       stristr('iso-2022-jp',$default_charset) ) {
+  if ( stristr($default_charset, 'iso-8859-') ||
+       stristr($default_charset, 'utf-8') || 
+       stristr($default_charset, 'iso-2022-jp') ) {
     if (function_exists('mb_convert_encoding')) {
       return mb_convert_encoding($str, $to_encoding, $from_encoding);
     }