Provide View Unsafe Images link on viewing a text/html attachment.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Aug 2006 19:34:27 +0000 (19:34 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Aug 2006 19:34:27 +0000 (19:34 +0000)
Thanks `Bicster'

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11619 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
src/view_text.php

index 9e9e7ea04042aafdaa089654685a300f8e83828b..ab855463bc9ceb94da5211b3203a636c5f498d10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,6 +131,7 @@ Version 1.5.2 - CVS
   - Drop obsolete script plugins/make_archive.pl.
   - Fix misspelled constant PREG_SPLIT_NI_EMPTY in sqimap_get_message
     (#1543573).
   - Drop obsolete script plugins/make_archive.pl.
   - Fix misspelled constant PREG_SPLIT_NI_EMPTY in sqimap_get_message
     (#1543573).
+  - Provide View Unsafe Images link on viewing a text/html attachment.
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------
index 0b3aeb8a102157d519479a31867da1ebcacc6e4b..b032b11a30fc3173ab843ab2837bcd44acc339f9 100644 (file)
@@ -48,6 +48,9 @@ $encoding = strtolower($header->encoding);
 $msg_url   = 'read_body.php?' . $QUERY_STRING;
 $msg_url   = set_url_var($msg_url, 'ent_id', 0);
 $dwnld_url = '../src/download.php?' . $QUERY_STRING . '&amp;absolute_dl=true';
 $msg_url   = 'read_body.php?' . $QUERY_STRING;
 $msg_url   = set_url_var($msg_url, 'ent_id', 0);
 $dwnld_url = '../src/download.php?' . $QUERY_STRING . '&amp;absolute_dl=true';
+$unsafe_url = 'view_text.php?' . $QUERY_STRING;
+$unsafe_url = set_url_var($unsafe_url, 'view_unsafe_images', 1);
+
 
 $body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
 $body = decodeBody($body, $encoding);
 
 $body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
 $body = decodeBody($body, $encoding);
@@ -62,10 +65,12 @@ if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
 }
 
 if ($type1 == 'html' || (isset($override_type1) &&  $override_type1 == 'html')) {
 }
 
 if ($type1 == 'html' || (isset($override_type1) &&  $override_type1 == 'html')) {
+    $ishtml = TRUE;
     $body = MagicHTML( $body, $passed_id, $message, $mailbox);
     // html attachment with character set information
     $body = MagicHTML( $body, $passed_id, $message, $mailbox);
     // html attachment with character set information
-    if (! empty($charset))
+    if (! empty($charset)) {
         $body = charset_decode($charset,$body,false,true);
         $body = charset_decode($charset,$body,false,true);
+    }
 } else {
     translateText($body, $wrap_at, $charset);
 }
 } else {
     translateText($body, $wrap_at, $charset);
 }
@@ -80,6 +85,9 @@ echo _("Viewing a text attachment") . ' - ' .
 ?>
 </b></td><tr><tr><td><div style="text-align: center;">
 <?php
 ?>
 </b></td><tr><tr><td><div style="text-align: center;">
 <?php
+if ( $ishtml ) {
+    echo '<a href="' . $unsafe_url . '">' . _("View Unsafe Images") . '</a> | ';
+}
 echo '<a href="' . $dwnld_url . '">' . _("Download this as a file") . '</a>';
 ?>
 </div><br />
 echo '<a href="' . $dwnld_url . '">' . _("Download this as a file") . '</a>';
 ?>
 </div><br />