From: fidian Date: Sat, 8 Sep 2001 01:37:56 +0000 (+0000) Subject: Altered HTML patch. X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=5f1c529a7908f8da58af57ef6b3581f7f7bacae7;ds=inline Altered HTML patch. This would be good with Philippe's code that strips out unliked HTML tags. Change the $show_html_default option to be something like 0 = no html (default) 1 = safe html 2 = any html git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1492 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/mime.php b/functions/mime.php index 278c0d95..f032ece7 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -535,7 +535,8 @@ // this if statement checks for the entity to show as the // primary message. To add more of them, just put them in the // order that is their priority. - global $startMessage, $username, $key, $imapServerAddress, $imapPort; + global $startMessage, $username, $key, $imapServerAddress, $imapPort, + $show_html_default; $id = $message->header->id; $urlmailbox = urlencode($message->header->mailbox); @@ -552,7 +553,7 @@ // If there are other types that shouldn't be formatted, add // them here - if ($body_message->header->type1 != "html") { + if ($body_message->header->type1 != "html" && $show_html_default) { translateText($body, $wrap_at, $body_message->header->charset); } @@ -690,13 +691,6 @@ $body = base64_decode($body); } - if (!$show_html_default) { - $body = str_replace('<', '<', $body); -// $body = str_replace('>', '>', $body); -// Both this and $body = htmlspecialchars($body); mess up inline -// quoting :-( Anyway, just replacing < gets the job done. - } - // All other encodings are returned raw. return $body; }