fixed bug #585340
authorcentaurix <centaurix@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 23 Jul 2002 11:32:20 +0000 (11:32 +0000)
committercentaurix <centaurix@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 23 Jul 2002 11:32:20 +0000 (11:32 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3124 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index 0e24912ae5513d1340d5c02b6d601851317378b6..83ffe5c24f77b8c89b191b9e3be091a2596a0ce1 100644 (file)
@@ -899,9 +899,17 @@ function saveAttachedFiles($session) {
     }
 
     if (!@rename($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) {
-        if (!@copy($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) {
+       if (function_exists("move_uploaded_file")) {
+               if (!@move_uploaded_file($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) {
             return true;
-        }
+               }
+       } else {
+
+               if (!@copy($HTTP_POST_FILES['attachfile']['tmp_name'], $full_localfilename)) {
+                   return true;
+                       }
+       }
+
     }
 
     $newAttachment['localfilename'] = $localfilename;