Sfoglia il codice sorgente

$utfencode and $htmlsave options were not followed in base64 decoding. Maybe
will come up with better if structure tomorrow or during weekend

tokul 21 anni fa
parent
commit
ef13b079c9
1 ha cambiato i file con 14 aggiunte e 7 eliminazioni
  1. 14 7
      functions/mime.php

+ 14 - 7
functions/mime.php

@@ -677,14 +677,21 @@ function decodeHeader ($string, $utfencode=true,$htmlsave=true,$decide=false) {
             {
             case 'B':
                 $replace = base64_decode($res[4]);
-                if ($can_be_encoded) {
-                  /* convert string to different charset,
-                   * if functions asks for it (usually in compose)
-                   */
-                  $ret .= charset_convert($res[2],$replace,$default_charset);
+                if ($utfencode) {
+                    if ($can_be_encoded) {
+                        /* convert string to different charset,
+                         * if functions asks for it (usually in compose)
+                         */
+                        $ret .= charset_convert($res[2],$replace,$default_charset);
+                    } else {
+                        // convert string to html codes in order to display it
+                        $ret .= charset_decode($res[2],$replace);
+                    }
                 } else {
-                  // convert string to html codes in order to display it
-                  $ret .= charset_decode($res[2],$replace);
+                    if ($htmlsave) {
+                        $replace = htmlspecialchars($replace);
+                    }
+                    $ret.= $replace;
                 }
                 break;
             case 'Q':