From fab65ca94e3a29606eababa9c5005e90e94cceb4 Mon Sep 17 00:00:00 2001 From: tokul Date: Thu, 28 Oct 2004 18:28:44 +0000 Subject: [PATCH] $utfencode and $htmlsave options were not followed in base64 decoding. Maybe will come up with better if structure tomorrow or during weekend git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8270 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 294e408e..f411393b 100644 --- a/functions/mime.php +++ b/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': -- 2.25.1