From 45cdd1b5d629eea0ec39342e0417a88903e82511 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 23 Sep 2002 12:31:10 +0000 Subject: [PATCH] Fix SRC directory being moved on Windows systems: check whether a file was really uploaded; if not bail out. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3715 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compose.php b/src/compose.php index 6590c1ba..539d8623 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1109,6 +1109,11 @@ function saveAttachedFiles($session) { global $_FILES, $attachment_dir, $attachments, $username, $data_dir, $compose_messages; + /* get out of here if no file was attached at all */ + if (! is_uploaded_file($_FILES['attachfile']['tmp_name']) ) { + return true; + } + $hashed_attachment_dir = getHashedDir($username, $attachment_dir); $localfilename = GenerateRandomString(32, '', 7); $full_localfilename = "$hashed_attachment_dir/$localfilename"; -- 2.25.1