Fix for bug 554789 Loose of attachements when using the html addressbook
[squirrelmail.git] / src / read_body.php
index b8b7da3b8b95788a7a8bac6eac6dbc841329ffef..a784ab43bcea7aaa7db2dd82180e23d2c84eeb8e 100644 (file)
@@ -32,10 +32,10 @@ function findNextMessage() {
            $server_sort_array;
     if (!is_array($server_sort_array)) {
         $thread_sort_messages = 0;
-        $allow_server_sort = 'false';
+        $allow_server_sort = FALSE;
     }
     $result = -1;
-    if ($thread_sort_messages == 1 || $allow_server_sort == 'true') {
+    if ($thread_sort_messages == 1 || $allow_server_sort == TRUE) {
         reset($server_sort_array);
         while(list($key, $value) = each ($server_sort_array)) {
             if ($currentArrayIndex == $value) {
@@ -48,13 +48,13 @@ function findNextMessage() {
             }
         }
     } 
-    elseif ($sort == 6 && $allow_server_sort != 'true' &&
+    elseif ($sort == 6 && $allow_server_sort != TRUE &&
             $thread_sort_messages != 1) {
         if ($currentArrayIndex != 1) {
             $result = $currentArrayIndex - 1;
         }
     }
-    elseif ($allow_server_sort != 'true' && $thread_sort_messages != 1 ) {
+    elseif ($allow_server_sort != TRUE && $thread_sort_messages != 1 ) {
         if (!is_array($msort)) {
             return -1;
         }
@@ -95,9 +95,9 @@ function findPreviousMessage() {
     $result = -1;
     if (!is_array($server_sort_array)) {
         $thread_sort_messages = 0;
-        $allow_server_sort = 'false';
+        $allow_server_sort = FALSE;
     }
-    if ($thread_sort_messages == 1 || $allow_server_sort == 'true') {
+    if ($thread_sort_messages == 1 || $allow_server_sort == TRUE) {
         reset($server_sort_array);
         while(list($key, $value) = each ($server_sort_array)) {
             if ($currentArrayIndex == $value) {
@@ -110,14 +110,14 @@ function findPreviousMessage() {
             }
         }
     }
-    elseif ($sort == 6 && $allow_server_sort != 'true' && 
+    elseif ($sort == 6 && $allow_server_sort != TRUE && 
             $thread_sort_messages != 1) {
         $numMessages = sqimap_get_num_messages($imapConnection, $mailbox);
         if ($currentArrayIndex != $numMessages) {
             $result = $currentArrayIndex + 1;
         }
     } 
-    elseif ($thread_sort_messages != 1 && $allow_server_sort != 'true') {
+    elseif ($thread_sort_messages != 1 && $allow_server_sort != TRUE) {
         if (!is_array($msort)) {
             return -1;
         }
@@ -284,7 +284,7 @@ function ClearAttachments() {
                $rem_attachments[] = $info;
            }
        }
-        $attachments = rem_attachments;
+        $attachments = $rem_attachments;
 }
 
 function formatRecipientString($recipients, $item ) {
@@ -700,7 +700,7 @@ if (($mailbox == $draft_folder) && ($save_as_draft)) {
 }
 if ($mailbox == $sent_folder) {
     echo '|&nbsp;<A HREF="' . $base_uri .
-         "src/compose.php?mailbox=$mailbox&amp;identity=$identity&amp;send_to=$url_to_string&amp;send_to_cc=$url_cc_string&amp;send_to_bcc=$url_bcc_string&amp;subject=$url_subj&amp;mailprio=$priority_level&amp;ent_num=$ent_num" . '"';
+         "src/compose.php?mailbox=$mailbox&amp;identity=$identity&amp;send_to=$url_to_string&amp;send_to_cc=$url_cc_string&amp;send_to_bcc=$url_bcc_string&amp;subject=$url_subj&amp;mailprio=$priority_level&amp;draft_id=$passed_id&amp;edit_as_new=1&amp;ent_num=$ent_num" . '"';
     if ($compose_new_win == '1') {
         echo ' TARGET="compose_window" onClick="comp_in_new()"';
     }
@@ -958,7 +958,7 @@ if ($default_use_mdn) {
                     _("The message sender has requested a response to indicate that you have read this message. Would you like to send a receipt?") .
                     "\")) {  \n" .
                     "                       window.location=($url); \n" .
-                    '                       window.reload()' . "\n" .
+                    '                       window.location.reload()' . "\n" .
                     '               }' . "\n" .
                     '// -->' . "\n" .
                     '</script>' . "\n";