summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/upload.inc
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-12-29 21:06:39 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-12-29 21:06:39 +0000
commitf4f322ec568a54b6e8b3a2f3eb581484543898e6 (patch)
treeb319ce048f0ac5a35781b68170a53df81c4c249d /roundcubemail/program/steps/mail/upload.inc
parent097e3924383ff388060e5639dbd53ea1a93da923 (diff)
Error handling for attachment uploads; multibyte-safe string functions; XSS improvements
git-svn-id: https://svn.roundcube.net/trunk@440 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/upload.inc')
-rw-r--r--roundcubemail/program/steps/mail/upload.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/upload.inc b/roundcubemail/program/steps/mail/upload.inc
index 0d9761e44..06ed26591 100644
--- a/roundcubemail/program/steps/mail/upload.inc
+++ b/roundcubemail/program/steps/mail/upload.inc
@@ -65,6 +65,16 @@ foreach ($_FILES['_attachments']['tmp_name'] as $i => $filepath)
$id,
$content);
}
+ else // upload failed
+ {
+ $err = $_FILES['_attachments']['error'][$i];
+ if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE)
+ $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes(ini_get('upload_max_filesize'))))));
+ else
+ $msg = rcube_label('fileuploaderror');
+
+ $response = sprintf("parent.%s.display_message('%s', 'error');", $JS_OBJECT_NAME, JQ($msg));
+ }
}