Since we're requiring PHP >= 4.0.4, we can just use move_upload_file
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 11 Jan 2003 13:52:15 +0000 (13:52 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 11 Jan 2003 13:52:15 +0000 (13:52 +0000)
because it was added in 4.0.3.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4414 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index 3333282..fd7e07c 100644 (file)
@@ -1176,17 +1176,10 @@ function saveAttachedFiles($session) {
         $full_localfilename = "$hashed_attachment_dir/$localfilename";
     }
 
-    if (!@rename($_FILES['attachfile']['tmp_name'], $full_localfilename)) {
-       if (function_exists("move_uploaded_file")) {
-            if (!@move_uploaded_file($_FILES['attachfile']['tmp_name'],$full_localfilename)) {
-               return true;
-           }
-       } else {
-           if (!@copy($_FILES['attachfile']['tmp_name'], $full_localfilename)) {
-                return true;
-            }
-       }
+    if (!@move_uploaded_file($_FILES['attachfile']['tmp_name'],$full_localfilename)) {
+        return true;
     }
+
     $message = $compose_messages[$session];
     $type = strtolower($_FILES['attachfile']['type']);
     $name = $_FILES['attachfile']['name'];