diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-04-06 11:33:13 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-04-06 11:33:13 +0000 |
| commit | 6598ea4ec898c0cebf7386c85bf0623738d3f422 (patch) | |
| tree | 7f2b7abf23ebd588e132d97f993cada3bf2437c6 /roundcubemail | |
| parent | ba99d97b8b1d7c77d91064b206e5f1e58fbff095 (diff) | |
- Fix 'temp_dir' does not support relative path under Windows (#1484529)
- add file_exists check for uploaded attachments
git-svn-id: https://svn.roundcube.net/trunk@2376 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail')
| -rw-r--r-- | roundcubemail/CHANGELOG | 1 | ||||
| -rw-r--r-- | roundcubemail/program/steps/mail/attachments.inc | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index 3e1c3ec32..e3742c2a5 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG RoundCube Webmail =========================== +- Fix 'temp_dir' does not support relative path under Windows (#1484529) - Fix "Initialize Database" button missing from installer (#1485802) - Fix compose window doesn't fit 1024x768 window (#1485396) - Fix service not available error when pressing back from compose dialog (#1485552) diff --git a/roundcubemail/program/steps/mail/attachments.inc b/roundcubemail/program/steps/mail/attachments.inc index b0a2a7e81..f6e29f9d7 100644 --- a/roundcubemail/program/steps/mail/attachments.inc +++ b/roundcubemail/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], |
