- E_NOTICE and unlink error message if user hits delete multiple times
authorjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 5 Nov 2005 23:38:04 +0000 (23:38 +0000)
committerjangliss <jangliss@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 5 Nov 2005 23:38:04 +0000 (23:38 +0000)
    before compose page has reloaded.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10259 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
src/compose.php

index c45eed715db4ded70dc88bb41cc49e3e115ae172..520c09f2db3d30b70d9cf05bdbcffb9fde828869 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -468,6 +468,9 @@ Version 1.5.1 -- CVS
   - Added site configuration options to bug_report plugin. Plugin is available
     only to interface administrators by default. See more information in 
     plugins/bug_report/README file.
+  - E_NOTICE and unlink error message if user hits delete multiple times
+    before compose page has reloaded.
+
 
 Version 1.5.0 - 2 February 2004
 -------------------------------
index d6bc77491c891422706c651c4ffbd33d733b1af6..2cc98bf7efbaf2ff1283a39a8027624056c3deb5 100644 (file)
@@ -593,9 +593,13 @@ elseif (isset($sigappend)) {
     if (isset($delete) && is_array($delete)) {
         $composeMessage = $compose_messages[$session];
         foreach($delete as $index) {
-            $attached_file = $composeMessage->entities[$index]->att_local_name;
-            unlink ($attached_file);
-            unset ($composeMessage->entities[$index]);
+            if (!empty($composeMessage->entities) && isset($composeMessage->entities[$index])) {
+                $attached_file = $composeMessage->entities[$index]->att_local_name;
+                if (file_exists($attached_file)) {
+                    unlink ($attached_file);
+                }
+                unset ($composeMessage->entities[$index]);
+            }
         }
         $new_entities = array();
         foreach ($composeMessage->entities as $entity) {
@@ -1692,4 +1696,4 @@ function deliverMessage($composeMessage, $draft=false) {
     return $succes;
 }
 
-?>
\ No newline at end of file
+?>