fix warnings
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 17 Apr 2002 04:35:09 +0000 (04:35 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 17 Apr 2002 04:35:09 +0000 (04:35 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2737 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index 0bde788309244c581752e858a3d1202543f7f915..ecf7e387d0fcd878af588c204a0fbdf841bd4c41 100644 (file)
@@ -872,15 +872,18 @@ function ClearAttachments($session)
     $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
 
     $rem_attachments = array();
-    foreach ($attachments as $info) {
-       if ($info['session'] == $session) {
-           $attached_file = "$hashed_attachment_dir/$info[localfilename]";
-           if (file_exists($attached_file)) {
-               unlink($attached_file);
-           }
-       } else {
-           $rem_attachments[] = $info;
-       }
+    if (is_array($attachments)) {
+        foreach ($attachments as $info) {
+               if ($info['session'] == $session) {
+               $attached_file = "$hashed_attachment_dir/$info[localfilename]";
+               if (file_exists($attached_file)) {
+                       unlink($attached_file);
+               }
+               } 
+            else {
+                   $rem_attachments[] = $info;
+               }
+        }
     }
     $attachments = $rem_attachments;
 }