From bf74a6364b9481a1ba5d0f46919d7479c37f0785 Mon Sep 17 00:00:00 2001 From: gustavf Date: Fri, 24 Mar 2000 11:09:19 +0000 Subject: [PATCH] Fixed bug: Charset was not taken into account for single-part messages. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@326 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 6 +++--- functions/mime.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 00357d62..fb996501 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -86,7 +86,7 @@ $message["INFO"]["ID"] = $id; $message["INFO"]["MAILBOX"] = $mailbox; $message["HEADER"] = sqimap_get_message_header($imap_stream, $id); - $message["ENTITIES"] = sqimap_get_message_body($imap_stream, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"], $message["HEADER"]["ENCODING"]); + $message["ENTITIES"] = sqimap_get_message_body($imap_stream, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"], $message["HEADER"]["ENCODING"], $message["HEADER"]["CHARSET"]); return $message; } @@ -282,7 +282,7 @@ /****************************************************************************** ** Returns the body of a message. ******************************************************************************/ - function sqimap_get_message_body ($imap_stream, $bound, $id, $type0, $type1, $encoding) { + function sqimap_get_message_body ($imap_stream, $bound, $id, $type0, $type1, $encoding, $charset) { fputs ($imap_stream, "a001 FETCH $id:$id BODY[TEXT]\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); @@ -297,6 +297,6 @@ } $body = $bodytmp; - return decodeMime($body, $bound, $type0, $type1, $encoding); + return decodeMime($body, $bound, $type0, $type1, $encoding, $charset); } ?> diff --git a/functions/mime.php b/functions/mime.php index cbc7d205..ecbc6abc 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -14,7 +14,7 @@ /** This is the first function called. It decides if this is a multipart message or if it should be handled as a single entity **/ - function decodeMime($body, $bound, $type0, $type1, $encoding, &$entities) { + function decodeMime($body, $bound, $type0, $type1, $encoding, $charset, &$entities) { if ($type0 == "multipart") { $bound = trim($bound); $i = 0; @@ -53,7 +53,7 @@ $y++; $j++; } - $ent = decodeMime($ent_body, $ent_bound, $ent_type0, $ent_type1, $entities); + $ent = decodeMime($ent_body, $ent_bound, $ent_type0, $ent_type1, $charset, $entities); $entities = $ent; } else { $j++; -- 2.25.1