Check for empty default_charset in imap_utf7_decode_local() too. Duplicate code is...
authoralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jul 2003 01:50:11 +0000 (01:50 +0000)
committeralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 27 Jul 2003 01:50:11 +0000 (01:50 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5432 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_utf7_local.php

index 5478ea6b35827c5780aed2ad2caa8905ef8f7d3d..c2a9ce8b7f2fb401922e2f9192ebeb46e7d1aefd 100644 (file)
@@ -91,8 +91,8 @@ function imap_utf7_decode_local($s) {
       return '';
 
     global $default_charset;
-    set_my_charset();
-    if (strtolower($default_charset) != 'iso-8859-1') {
+    set_my_charset();  //must be called before using $default_charset
+    if ((strtolower($default_charset) != 'iso-8859-1') && ($default_charset != '')) {
       $utf7_s = sqimap_mb_convert_encoding($s, $default_charset, 'UTF7-IMAP', $default_charset);
       if ($utf7_s != '')
         return $utf7_s;