Bläddra i källkod

Fixed bug #124841 where the Content-Type header charset wasn't parsed correctly.

pallo 24 år sedan
förälder
incheckning
cef8b45c7a
2 ändrade filer med 3 tillägg och 3 borttagningar
  1. 1 1
      functions/i18n.php
  2. 2 2
      functions/imap_messages.php

+ 1 - 1
functions/i18n.php

@@ -57,7 +57,7 @@
 
 
       if ($debug_mime) $string = $charset.":".$string;
       if ($debug_mime) $string = $charset.":".$string;
 
 
-      if (ereg("iso-8859-(.*)", $charset, $res)) {
+      if (ereg("iso-8859-([[:digit:]]+)", $charset, $res)) {
          if ($res[1] == "1")
          if ($res[1] == "1")
             return charset_decode_iso_8859_1 ($string);
             return charset_decode_iso_8859_1 ($string);
          else if ($res[1] == "2")
          else if ($res[1] == "2")

+ 2 - 2
functions/imap_messages.php

@@ -243,8 +243,8 @@
             if (strpos(strtolower(trim($line)), "charset=")) {
             if (strpos(strtolower(trim($line)), "charset=")) {
                $pos = strpos($line, "charset=") + 8;
                $pos = strpos($line, "charset=") + 8;
                $charset = trim($line);
                $charset = trim($line);
-               if (strpos($line, " ", $pos) > 0) {
-                  $charset = substr($charset, $pos, strpos($line, " ", $pos));
+               if (strpos($line, ";", $pos) > 0) {
+                  $charset = substr($charset, $pos, strpos($line, ";", $pos)-$pos);
                } else {
                } else {
                   $charset = substr($charset, $pos);
                   $charset = substr($charset, $pos);
                }
                }