Fix SRC directory being moved on Windows systems: check whether a file was really...
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Sep 2002 12:31:10 +0000 (12:31 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Sep 2002 12:31:10 +0000 (12:31 +0000)
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

index 6590c1ba73d6f5d3cbf10e6952c017f7da9dfe8e..539d8623710bdc28a0cb8347b8d19d0ed86d58a4 100644 (file)
@@ -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";