Browse Source

Since we're requiring PHP >= 4.0.4, we can just use move_upload_file
because it was added in 4.0.3.

Thijs Kinkhorst 22 years ago
parent
commit
242c603c6f
1 changed files with 3 additions and 10 deletions
  1. 3 10
      src/compose.php

+ 3 - 10
src/compose.php

@@ -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'];