disable regexp compilation error
[squirrelmail.git] / src / read_body.php
index eeb8d8c043c1eab1a3557069cb83b6efd14247bf..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  = htmlspecialchars($deliver->dlv_msg) . '<br />' .
-                _("Server replied:") . ' ' . htmlspecialchars($deliver->dlv_ret_nr . ' ' .
-                $deliver->dlv_server_msg);
+        $msg = $deliver->dlv_msg;
+        if (! empty($deliver->dlv_server_msg)) {
+            $msg.= '<br />' .
+                _("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
+                nl2br(htmlspecialchars($deliver->dlv_server_msg));
+        }
         require_once(SM_PATH . 'functions/display_messages.php');
         plain_error_message($msg, $color);
     } else {
@@ -1028,6 +1032,5 @@ sqimap_logout($imapConnection);
  */
 $mailbox_cache[$iAccount.'_'.$aMailbox['NAME']] = $aMailbox;
 sqsession_register($mailbox_cache,'mailbox_cache');
-
+$oTemplate->display('footer.tpl');
 ?>
-</body></html>