centaurix 23 年之前
父节点
当前提交
a8ae2e35cb
共有 1 个文件被更改,包括 10 次插入2 次删除
  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;