Allowing display of unsafe images when viewing HTML attachments and when HTML is...
authorjervfors <jervfors@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 12 Mar 2006 01:50:54 +0000 (01:50 +0000)
committerjervfors <jervfors@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 12 Mar 2006 01:50:54 +0000 (01:50 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10971 7612ce4b-ef26-0410-bec9-ea0150e637f0

doc/Development/plugin.txt
src/view_html.php
src/view_text.php

index a8bb6d42160bb1074d0a1e1160d371d4b04cb709..784b45194184806fc61f77fae680f05c5866ba0b 100644 (file)
@@ -386,6 +386,8 @@ but may be out of date soon thereafter.  You never know.  ;-)
   search_after_form              src/search.php                  do_hook
   search_bottom                  src/search.php                  do_hook
   logout                         src/signout.php                 do_hook
+  message_body (since 1.5.2)     src/view_html.php               do_hook
+  message_body (since 1.5.2)     src/view_text.php               do_hook
   webmail_top                    src/webmail.php                 do_hook
   webmail_bottom                 src/webmail.php                 concat_hook
   logout_above_text              src/signout.php                 concat_hook
index b7ac88020ed68727861eb51ba6c70272ee084fd7..0763b191560bd499b54a0996e183a45f1361826d 100644 (file)
@@ -38,13 +38,6 @@ if (sqgetGlobalVar('passed_id', $temp, SQ_GET)) {
     $passed_id = (int) $temp;
 }
 
-global $view_unsafe_images;
-if (sqgetGlobalVar('view_unsafe_images', $temp, SQ_GET)) {
-    $view_unsafe_images = (bool) $temp;
-} else {
-    $view_unsafe_images = false;
-}
-
 // TODO: add required var checks here.
 
 $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
@@ -66,6 +59,8 @@ $encoding = strtolower($header->encoding);
 
 $body = mime_fetch_body($imap_stream, $passed_id, $ent_id);
 $body = decodeBody($body, $encoding);
+$hookResults = do_hook('message_body', $body);
+$body = $hookResults[1];
 
 /**
  * TODO: check if xtra_code is needed.
@@ -84,4 +79,4 @@ $body = MagicHTML( $body, $passed_id, $message, $mailbox);
 header('Content-Type: text/html; charset=' . $charset);
 echo $body;
 
-?>
+?>
\ No newline at end of file
index 685b1b0fcde3681859114b0f23b01f01f60225f6..3f3bff810ad03b40a68543e27f342e46ef6edbc3 100644 (file)
@@ -61,6 +61,8 @@ $dwnld_url = '../src/download.php?' . $QUERY_STRING . '&amp;absolute_dl=true';
 
 $body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
 $body = decodeBody($body, $encoding);
+$hookResults = do_hook('message_body', $body);
+$body = $hookResults[1];
 
 if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
     function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_decode')) {