From c7580d5532828e80dc36bc9575f285a334f19838 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 23 May 2022 00:25:07 +0000 Subject: [PATCH] Greatly fix the plaintext display of messages that do not have a text part. Patch from Alexey Shpakovsky (#496) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14961 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 7e67f00d..1f02367b 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -396,18 +396,38 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma */ if ($body_message->header->type1 == 'html') { - if ($show_html_default <> 1) { + // Do we need to make an HTML part viewable as non-HTML plain text? + if ($show_html_default != 1) { $entity_conv = array(' ' => ' ', - '

' => "\n", - '

' => "\n", - '
' => "\n", - '
' => "\n", - '
' => "\n", - '
' => "\n", + // These are better done by regex (below) + // '

' => "\n", + // '

' => "\n", + // '
' => "\n", + // '
' => "\n", + // '
' => "\n", + // '
' => "\n", + // '' => "\n", + // '

' => "\n", '>' => '>', - '<' => '<'); + '<' => '<', + '&' => '&', + '©' => '©'); + // first, completely remove