From d03c24f441f716ed214a7b8e02820e1c3d168b98 Mon Sep 17 00:00:00 2001 From: brong Date: Tue, 19 Feb 2002 12:37:45 +0000 Subject: [PATCH] Added a link allowing you to view all 'removed for security reasons' images for this specific message. It is only shown when at least one message has been removed. (because people want it, including me!) Strings "View unsafe images" and "Don't view unsafe images" for the translators. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2473 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/functions/mime.php b/functions/mime.php index 3c2f125c..bca16114 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -605,7 +605,9 @@ function formatBody($imap_stream, $message, $color, $wrap_at) { // primary message. To add more of them, just put them in the // order that is their priority. global $startMessage, $username, $key, $imapServerAddress, $imapPort, - $show_html_default; + $show_html_default, $has_unsafe_images, $view_unsafe_images, $sort; + + $has_unsafe_images = 0; $id = $message->header->id; $urlmailbox = urlencode($message->header->mailbox); @@ -636,6 +638,13 @@ function formatBody($imap_stream, $message, $color, $wrap_at) { } $body .= "
". _("Download this as a file") ."

"; + if ($has_unsafe_images) { + if ($view_unsafe_images) { + $body .= "
". _("Don't view unsafe images") ."

\n"; + } else { + $body .= "
". _("View unsafe images") ."

\n"; + } + } /** Display the ATTACHMENTS: message if there's more than one part **/ if (isset($message->entities[0])) { @@ -1131,7 +1140,7 @@ change on with no (onload -> noload) function stripEvent( &$i, $j, &$body, $id, $base ) { - global $message, $base_uri; + global $message, $base_uri, $has_unsafe_images, $view_unsafe_images; $ret = ''; @@ -1170,7 +1179,10 @@ function stripEvent( &$i, $j, &$body, $id, $base ) { } else if ( strtolower( substr( $src, 0, 4 ) ) <> 'http' || stristr( $src, $base_uri ) ) { /* Javascript and local urls goes out */ - $src = '../images/' . _("sec_remove_eng.png"); + if (!$view_unsafe_images) { + $src = '../images/' . _("sec_remove_eng.png"); + } + $has_unsafe_images = 1; } $ret .= 'src="' . $src . '" '; $i = $k - 2; -- 2.25.1