From c4ad259b1b5bac1d8387d43b0e2b4b308d386fa4 Mon Sep 17 00:00:00 2001 From: indiri69 Date: Wed, 21 Aug 2002 17:17:21 +0000 Subject: [PATCH] How we call findDisplayEntity should depend on whether we want to show HTML documents. Otherwise we end up displaying a plain text version of the HTML part instead of the text/plain part. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3388 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/read_body.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/read_body.php b/src/read_body.php index bbfbd21f..6d577136 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -485,9 +485,9 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp $comp_action_uri = $comp_uri . '&action=forward_as_attachment'; if ($compose_new_win == '1') { $s .= ''._("Forward as Attachment").''; + 'onclick="comp_in_new(\''.$comp_action_uri.'\')">'._("Forward as attachment").''; } else { - $s .= ''._("Forward as Attachment").''; + $s .= ''._("Forward as attachment").''; } $s .= $topbar_delimiter; @@ -635,7 +635,12 @@ if (isset($sendreceipt)) { $msgs[$passed_id]['FLAG_SEEN'] = true; $messagebody = ''; -$ent_ar = $message->findDisplayEntity(array()); +do_hook('read_body_top'); +if ($show_html_default == 1) { + $ent_ar = $message->findDisplayEntity(array()); +} else { + $ent_ar = $message->findDisplayEntity(array(), array('text/plain')); +} $cnt = count($ent_ar); for ($i = 0; $i < $cnt; $i++) { $messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox); @@ -645,7 +650,6 @@ for ($i = 0; $i < $cnt; $i++) { } displayPageHeader($color, $mailbox); -do_hook('read_body_top'); formatMenuBar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response); formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee); echo ''; -- 2.25.1