Browse Source

Check for empty default_charset in imap_utf7_decode_local() too. Duplicate code is bad :(.

alex-brainstorm 22 năm trước cách đây
mục cha
commit
9ac1362720
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      functions/imap_utf7_local.php

+ 2 - 2
functions/imap_utf7_local.php

@@ -91,8 +91,8 @@ function imap_utf7_decode_local($s) {
       return '';
       return '';
 
 
     global $default_charset;
     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);
       $utf7_s = sqimap_mb_convert_encoding($s, $default_charset, 'UTF7-IMAP', $default_charset);
       if ($utf7_s != '')
       if ($utf7_s != '')
         return $utf7_s;
         return $utf7_s;