fix for not defined $sort
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 15 Mar 2002 11:33:55 +0000 (11:33 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 15 Mar 2002 11:33:55 +0000 (11:33 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2583 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/read_body.php

index 030221c..2cddd9d 100644 (file)
@@ -195,12 +195,12 @@ function SendMDN ( $recipient , $sender) {
     $newAttachment = array();
     $newAttachment['localfilename'] = $localfilename;
     $newAttachment['type'] = "message/disposition-notification";
-
+    $newAttachment['session']=-1;
     $attachments[] = $newAttachment;
     $MDN_to = trim($recipient);
     $reply_id = 0;
 
-    return (SendMessage($MDN_to,'','', _("Read:") . ' ' . $subject, $body,$reply_id, True, 3) );
+    return (SendMessage($MDN_to,'','', _("Read:") . ' ' . $subject, $body,$reply_id, True, 3, -1) );
 }
 
 
@@ -219,18 +219,22 @@ function ClearAttachments() {
 
         $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
 
+       $rem_attachments = array();
         foreach ($attachments as $info) {
-            $attached_file = "$hashed_attachment_dir/$info[localfilename]";
-            if (file_exists($attached_file)) {
-                unlink($attached_file);
-            }
-        }
-
-        $attachments = array();
+           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 $base_uri, $passed_id, $urlMailbox, $startMessage, $show_more_cc, $echo_more, $echo_less, $show_more, $show_more_bcc;
+    global $base_uri, $passed_id, $urlMailbox, $startMessage, $show_more_cc, $echo_more, $echo_less, $show_more, $show_more_bcc, $sort;
 
     $i = 0;
     $url_string = '';