summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-11-19 13:43:43 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-11-19 13:43:43 +0100
commit271c5c976433c8318510ab16071dd3fa4cfe87c0 (patch)
tree7367312846a27ef1afeb0137f4d4f9c4935b3261 /program/steps/mail
parent19de536b86e29ed7961b2d50223106c31a436106 (diff)
Correctly handle multiple file uploads (#1488820)
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/attachments.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index 21a9f5b99..180fc0bb9 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -89,6 +89,8 @@ $OUTPUT->reset();
$uploadid = get_input_value('_uploadid', RCUBE_INPUT_GET);
if (is_array($_FILES['_attachments']['tmp_name'])) {
+ $multiple = count($_FILES['_attachments']['tmp_name']) > 1;
+
foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath) {
// Process uploaded attachment if there is no error
$err = $_FILES['_attachments']['error'][$i];
@@ -149,8 +151,10 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
$msg = rcube_label('fileuploaderror');
}
- $OUTPUT->command('display_message', $msg, 'error');
- $OUTPUT->command('remove_from_attachment_list', $uploadid);
+ if ($attachment['error'] || $err != UPLOAD_ERR_NO_FILE) {
+ $OUTPUT->command('display_message', $msg, 'error');
+ $OUTPUT->command('remove_from_attachment_list', $uploadid);
+ }
}
}
}