Check for empty default_charset. RCS tag string fixed ;)
authoralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 26 Jul 2003 18:54:44 +0000 (18:54 +0000)
committeralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 26 Jul 2003 18:54:44 +0000 (18:54 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5427 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_utf7_local.php

index 7f56d606eed05e532f1a33070cd8e290dfcb564d..5478ea6b35827c5780aed2ad2caa8905ef8f7d3d 100644 (file)
@@ -8,7 +8,7 @@
  *
  * This implements all functions that do imap UTF7 conversions.
  *
- * $Id $
+ * $Id$
  */
 
 function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default_charset)
@@ -38,8 +38,8 @@ function imap_utf7_encode_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, 'UTF7-IMAP', $default_charset, $default_charset);
       if ($utf7_s != '')
         return $utf7_s;