From: jmunro Date: Wed, 17 Apr 2002 04:35:09 +0000 (+0000) Subject: fix warnings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8712abeabfc39f4afd65ba3e2aaa7da13e93d949;p=squirrelmail.git fix warnings git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2737 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/compose.php b/src/compose.php index 0bde7883..ecf7e387 100644 --- a/src/compose.php +++ b/src/compose.php @@ -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; }