XHTML fixes
[squirrelmail.git] / src / read_body.php
index e07ab9db62189953a5d8505d2de76ce365a8c7e9..57b1bd6f6309694592c69c6cd09ec4fdcffdf04a 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * read_body.php
  *
@@ -202,6 +203,8 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
                 $special_encoding = '7bit';
             }
         }
+    } elseif (sq_is8bit($body)) {
+        $special_encoding = '8bit';
     }
     $part1 = new Message();
     $part1->setBody($body);
@@ -302,7 +305,7 @@ function ClearAttachments() {
             if ($info['session'] == -1) {
                 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
                 if (file_exists($attached_file)) {
-                        unlink($attached_file);
+                    unlink($attached_file);
                 }
             } else {
                 $rem_attachments[] = $info;
@@ -369,9 +372,9 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
                          $color, $FirstTimeSee) {
     global $msn_user_support, $default_use_mdn, $default_use_priority,
            $show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on,
-          $squirrelmail_language;
+           $squirrelmail_language;
 
-    $mailbox = $aMailbox['NAME']       ;
+    $mailbox = $aMailbox['NAME'];
 
     $header = $message->rfc822_header;
     $env = array();
@@ -596,7 +599,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
 
 
     // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc.
-    $menu_row = '<tr bgcolor="'.$color[9].'"><td><small>';
+    $menu_row = '<tr bgcolor="'.$color[0].'"><td><small>';
     $comp_uri = $base_uri.'src/compose.php' .
                 '?passed_id=' . $passed_id .
                 '&amp;mailbox=' . $urlMailbox .
@@ -648,6 +651,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
         if (!(isset($passed_ent_id) && $passed_ent_id)) {
             $menu_row .= addHidden('mailbox', $aMailbox['NAME']);
             $menu_row .= addHidden('msg[0]', $passed_id);
+            $menu_row .= addHidden('startMessage', $startMessage);
             $menu_row .= getButton('submit', 'delete', _("Delete"));
             $menu_row .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
         } else {
@@ -849,7 +853,7 @@ $header = $message->header;
 if (isset($sendreceipt)) {
    if ( !$message->is_mdnsent ) {
       $final_recipient = '';
-      if ((isset($identity)) && ($identity != 0))      //Main identity
+      if ((isset($identity)) && ($identity != 0)) //Main identity
          $final_recipient = trim(getPref($data_dir, $username, 'email_address' . $identity, '' ));
       if ($final_recipient == '' )
          $final_recipient = trim(getPref($data_dir, $username, 'email_address', '' ));
@@ -879,7 +883,7 @@ $cnt = count($ent_ar);
 for ($i = 0; $i < $cnt; $i++) {
    $messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
    if ($i != $cnt-1) {
-       $messagebody .= '<hr noshade size="1" />';
+       $messagebody .= '<hr style="height: 1px;" />';
    }
 }
 
@@ -955,5 +959,4 @@ sqimap_logout($imapConnection);
 $mailbox_cache[$aMailbox['NAME']] = $aMailbox;
 sqsession_register($mailbox_cache,'mailbox_cache');
 ?>
-</body>
-</html>
+</body></html>
\ No newline at end of file