summaryrefslogtreecommitdiff
path: root/program/steps/mail/attachments.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2009-05-15 10:22:29 +0000
committerthomascube <thomas@roundcube.net>2009-05-15 10:22:29 +0000
commit51ede06434097ef8d0697ee204fa998d6445d194 (patch)
tree76d6362bca66010776af8e8fbb971ba848cc3215 /program/steps/mail/attachments.inc
parent9bee4437b889f4e36e37116ebf1fc24765eecad6 (diff)
Apply changes from r2348 to r2400 for 0.2.2 release
Diffstat (limited to 'program/steps/mail/attachments.inc')
-rw-r--r--program/steps/mail/attachments.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index b0a2a7e81..f6e29f9d7 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -63,6 +63,11 @@ if ($RCMAIL->action=='display-attachment')
// use common temp dir for file uploads
$temp_dir = unslashify($CONFIG['temp_dir']);
+// #1484529: we need absolute path on Windows for move_uploaded_file()
+if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+ $temp_dir = realpath($temp_dir);
+}
+
if (!is_array($_SESSION['compose']['attachments'])) {
$_SESSION['compose']['attachments'] = array();
}
@@ -73,7 +78,7 @@ $OUTPUT->reset();
if (is_array($_FILES['_attachments']['tmp_name'])) {
foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) {
$tmpfname = tempnam($temp_dir, 'rcmAttmnt');
- if (move_uploaded_file($filepath, $tmpfname)) {
+ if (move_uploaded_file($filepath, $tmpfname) && file_exists($tmpfname)) {
$id = count($_SESSION['compose']['attachments']);
$_SESSION['compose']['attachments'][] = array(
'name' => $_FILES['_attachments']['name'][$i],