- Fixed bug #1032366, remove NUL characters in text attachments on sent.
[squirrelmail.git] / src / read_body.php
index d3dd8657a4238ee600b39f8dc0bac15f1d63ff1a..f32330b1bd2993b404444390d510c3185124d574 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * read_body.php
  *
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This file is used for reading the msgs array and displaying
@@ -93,9 +93,16 @@ function findPreviousMessage($uidset, $passed_id) {
 function printer_friendly_link($mailbox, $passed_id, $passed_ent_id) {
     global $javascript_on;
 
+    /* hackydiehack */
+    if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
+        $view_unsafe_images = false;
+    } else {
+        $view_unsafe_images = true;
+    }
     $params = '?passed_ent_id=' . urlencode($passed_ent_id) .
               '&mailbox=' . urlencode($mailbox) .
-              '&passed_id=' . urlencode($passed_id);
+              '&passed_id=' . urlencode($passed_id).
+              '&view_unsafe_images='. (bool) $view_unsafe_images;
 
     $print_text = _("View Printable Version");
 
@@ -125,14 +132,13 @@ function ServerMDNSupport($aFlags) {
 }
 
 function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
-    global $username, $attachment_dir, $popuser, $username,
+    global $username, $attachment_dir, $popuser, $username, $color,
            $version, $squirrelmail_language, $default_charset,
            $languages, $useSendmail, $domain, $sent_folder;
 
     sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
 
     $header = $message->rfc822_header;
-    $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
 
     $rfc822_header = new Rfc822Header();
     $content_type  = new ContentType('multipart/report');
@@ -609,17 +615,20 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
     $target = '';
     $on_click='';
     $method='method="post" ';
+    $onsubmit='';
     if ($compose_new_win == '1') {
         if ( $javascript_on ) {
           $on_click=' onclick="comp_in_new_form(\''.$comp_uri.'\', this, this.form)"';
           $comp_uri = 'javascript:void(0)';
           $method='method="get" ';
+          $onsubmit = 'onsubmit="return false" ';
         } else {
           $target = 'target="_blank"';
         }
     }
 
-    $menu_row .= "\n".'<form name="composeForm" action="'.$comp_uri.'" '.$method.$target.' style="display: inline">'."\n";
+    $menu_row .= "\n".'<form name="composeForm" action="'.$comp_uri.'" '
+              . $method.$target.$onsubmit.' style="display: inline">'."\n";
 
     // If Draft folder - create Resume link
     if (($mailbox == $draft_folder) && ($save_as_draft)) {