From 23f617b8892f3f2ae88829f9432815cca3832040 Mon Sep 17 00:00:00 2001 From: stekkel Date: Mon, 27 Jan 2003 09:06:21 +0000 Subject: [PATCH] fix for unsafe images links. Somehow the wrong were in de view unsafe images link. passed_ent_id is used in case of attached message/rfc822 messages, ent_id is used for specifying the mime-entity_id. If passed_ent_id is available we know that the message with entity_id = passed_ent_id contains a rfc822header. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4475 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 9edb776d..320e67e5 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -319,7 +319,7 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma * order that is their priority. */ global $startMessage, $username, $key, $imapServerAddress, $imapPort, - $show_html_default, $sort, $has_unsafe_images; + $show_html_default, $sort, $has_unsafe_images, $passed_ent_id; if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) { $view_unsafe_images = false; @@ -360,21 +360,24 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma translateText($body, $wrap_at, $body_message->header->getParameter('charset')); } - + $link = 'read_body.php?passed_id=' . $id . '&ent_id='.$ent_num. + '&mailbox=' . $urlmailbox .'&sort=' . $sort . + '&startMessage=' . $startMessage . '&show_more=0'; + if (isset($passed_ent_id)) { + $link .= '&passed_ent_id='.$passed_ent_id; + } if ($view_unsafe_images) { - $untext = '">' . _("Hide Unsafe Images"); + $text = _("Hide Unsafe Images"); } else { if (isset($has_unsafe_images) && $has_unsafe_images) { - $untext = '&view_unsafe_images=1">' . _("View Unsafe Images"); + $link .= '&view_unsafe_images=1'; + $text = _("View Unsafe Images"); } else { - $untext = '">'; + $text = ''; } } - $body .= '
'.$text. + '

' . "\n"; } return $body; } -- 2.25.1