From 3309f5b9ac78fe8e336d772cad928d2718588f14 Mon Sep 17 00:00:00 2001 From: pallo Date: Thu, 7 Dec 2000 13:43:38 +0000 Subject: [PATCH] Fixed bug #124841 where the Content-Type header charset wasn't parsed correctly. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@877 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/i18n.php | 2 +- functions/imap_messages.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/i18n.php b/functions/i18n.php index 905da99d..9d1f0f12 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -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") diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 98449ad9..a28dc43d 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -243,8 +243,8 @@ 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); } -- 2.25.1