disable regexp compilation error
[squirrelmail.git] / src / read_body.php
index e15be367f74b0803cb593dee27b1e9c0de12eeb3..2e45408826e51ca3e0d1e05d3565da258c4c655a 100644 (file)
@@ -6,7 +6,7 @@
  * This file is used for reading the msgs array and displaying
  * the resulting emails in the right frame.
  *
- * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/global.php');
+include_once(SM_PATH . 'include/validate.php');
+//require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/mime.php');
 require_once(SM_PATH . 'functions/date.php');
 require_once(SM_PATH . 'functions/url_parser.php');
 require_once(SM_PATH . 'functions/html.php');
-require_once(SM_PATH . 'functions/global.php');
+//require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/identity.php');
 include_once(SM_PATH . 'functions/arrays.php');
 include_once(SM_PATH . 'functions/mailbox_display.php');
@@ -80,7 +80,7 @@ function findPreviousMessage($uidset, $passed_id) {
  * @param int $passed_id
  */
 function printer_friendly_link($mailbox, $passed_id, $passed_ent_id) {
-    global $javascript_on;
+    global $javascript_on, $show_html_default;
 
     /* hackydiehack */
     if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
@@ -90,8 +90,9 @@ function printer_friendly_link($mailbox, $passed_id, $passed_ent_id) {
     }
     $params = '?passed_ent_id=' . urlencode($passed_ent_id) .
               '&mailbox=' . urlencode($mailbox) .
-              '&passed_id=' . urlencode($passed_id).
-              '&view_unsafe_images='. (bool) $view_unsafe_images;
+              '&passed_id=' . urlencode($passed_id) .
+              '&view_unsafe_images='. (bool) $view_unsafe_images .
+              '&show_html_default=' . $show_html_default;
 
     $print_text = _("View Printable Version");
 
@@ -262,9 +263,12 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
         $success = $deliver->finalizeStream($stream);
     }
     if (!$success) {
-        $msg  = $deliver->dlv_msg . '<br />' .
+        $msg = $deliver->dlv_msg;
+        if (! empty($deliver->dlv_server_msg)) {
+            $msg.= '<br />' .
                 _("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
-                $deliver->dlv_server_msg;
+                nl2br(htmlspecialchars($deliver->dlv_server_msg));
+        }
         require_once(SM_PATH . 'functions/display_messages.php');
         plain_error_message($msg, $color);
     } else {
@@ -288,27 +292,6 @@ function ToggleMDNflag ($set ,$imapConnection, $mailbox, $passed_id) {
                                 $readmessage, TRUE);
 }
 
-function ClearAttachments() {
-    global $username, $attachments, $attachment_dir;
-
-    $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-
-    $rem_attachments = array();
-    if (isset($attachments)) {
-        foreach ($attachments as $info) {
-            if ($info['session'] == -1) {
-                $attached_file = "$hashed_attachment_dir/$info[localfilename]";
-                if (file_exists($attached_file)) {
-                    unlink($attached_file);
-                }
-            } else {
-                $rem_attachments[] = $info;
-            }
-        }
-    }
-    $attachments = $rem_attachments;
-}
-
 function formatRecipientString($recipients, $item ) {
     global $show_more_cc, $show_more, $show_more_bcc,
            $PHP_SELF;
@@ -954,7 +937,6 @@ if (isset($sendreceipt)) {
          $message->is_mdnsent = true;
          $aMailbox['MSG_HEADERS'][$passed_id]['MESSAGE_OBJECT'] = $message;
       }
-      ClearAttachments();
    }
 }
 /***********************************************/
@@ -1050,6 +1032,5 @@ sqimap_logout($imapConnection);
  */
 $mailbox_cache[$iAccount.'_'.$aMailbox['NAME']] = $aMailbox;
 sqsession_register($mailbox_cache,'mailbox_cache');
-
+$oTemplate->display('footer.tpl');
 ?>
-</body></html>
\ No newline at end of file