Fixed bug #124841 where the Content-Type header charset wasn't parsed correctly.
authorpallo <pallo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 7 Dec 2000 13:43:38 +0000 (13:43 +0000)
committerpallo <pallo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 7 Dec 2000 13:43:38 +0000 (13:43 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@877 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/i18n.php
functions/imap_messages.php

index 905da99da6bd73271e59eced1fde215b7bc7e6ba..9d1f0f12a548362d2a3c2e983633a3c6082a5585 100644 (file)
@@ -57,7 +57,7 @@
 
       if ($debug_mime) $string = $charset.":".$string;
 
-      if (ereg("iso-8859-(.*)", $charset, $res)) {
+      if (ereg("iso-8859-([[:digit:]]+)", $charset, $res)) {
          if ($res[1] == "1")
             return charset_decode_iso_8859_1 ($string);
          else if ($res[1] == "2")
index 98449ad9e079b567580e442a0dd9fd2b9f538364..a28dc43da6ba7af74eedb7da50b0aee947c473d8 100755 (executable)
             if (strpos(strtolower(trim($line)), "charset=")) {
                $pos = strpos($line, "charset=") + 8;
                $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 {
                   $charset = substr($charset, $pos);
                }