From 6191bcb1ca42141d5ec403d64ab47feffd0981aa Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 23 Jan 2003 16:49:20 +0000 Subject: [PATCH] fixed warning when attachments aren't set git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4453 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/read_body.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/read_body.php b/src/read_body.php index 57448d74..c7cd3966 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -320,15 +320,17 @@ function ClearAttachments() { $hashed_attachment_dir = getHashedDir($username, $attachment_dir); $rem_attachments = array(); - foreach ($attachments as $info) { - if ($info['session'] == -1) { - $attached_file = "$hashed_attachment_dir/$info[localfilename]"; - if (file_exists($attached_file)) { - unlink($attached_file); - } - } else { - $rem_attachments[] = $info; - } + if (isset($attachments)) { + foreach ($attachments as $info) { + 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; } -- 2.25.1