From 0a4cf77a26a217eadacccd629d2adfc755b58f0a Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 6 Jan 2000 21:31:40 +0000 Subject: [PATCH] translated the body to html so that < and > are displayed git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@119 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/download.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/download.php b/src/download.php index ce491fcf..480b694c 100644 --- a/src/download.php +++ b/src/download.php @@ -9,7 +9,7 @@ include("../src/load_prefs.php"); - function viewText($color, $body, $id, $entid, $mailbox) { + function viewText($color, $body, $id, $entid, $mailbox, $type1) { echo "\n"; displayPageHeader($color, "None"); @@ -18,7 +18,11 @@ echo ""; $urlmailbox = urlencode($mailbox); echo "
Download this as a file


"; - echo nl2br(trim($body)); + if ($type1 == "html") + echo nl2br(trim($body)); + else + echo nl2br(trim(htmlspecialchars($body))); + echo ""; } @@ -56,11 +60,11 @@ switch ($type0) { case "text": $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]); - viewText($color, $body, $passed_id, $passed_ent_id, $mailbox); + viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1); break; case "message": $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]); - viewText($color, $body, $passed_id, $passed_ent_id, $mailbox); + viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, $type1); break; default: $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]); -- 2.25.1