centaurix %!s(int64=23) %!d(string=hai) anos
pai
achega
a8ae2e35cb
Modificáronse 1 ficheiros con 10 adicións e 2 borrados
  1. 10 2
      src/compose.php

+ 10 - 2
src/compose.php

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