From a58b05b4855b7613d47caa567f0da78ca7cdd57b Mon Sep 17 00:00:00 2001 From: jangliss Date: Sat, 5 Nov 2005 23:38:04 +0000 Subject: [PATCH] - E_NOTICE and unlink error message if user hits delete multiple times 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 | 3 +++ src/compose.php | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c45eed71..520c09f2 100644 --- 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 ------------------------------- diff --git a/src/compose.php b/src/compose.php index d6bc7749..2cc98bf7 100644 --- a/src/compose.php +++ b/src/compose.php @@ -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 +?> -- 2.25.1