summaryrefslogtreecommitdiff
path: root/program/steps/mail/attachments.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-09-05 07:47:07 +0000
committeralecpl <alec@alec.pl>2009-09-05 07:47:07 +0000
commit7df0e352101c36d06e6831123be678a8a6b5077d (patch)
tree1dfbf242c28bf7b1b9fcdf1e5fc77afb2cd0df79 /program/steps/mail/attachments.inc
parent3dd90d323ddf11c271cb6f95d5f8f77c44253869 (diff)
- Check 'post_max_size' for upload max filesize (#1486089)
Diffstat (limited to 'program/steps/mail/attachments.inc')
-rw-r--r--program/steps/mail/attachments.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/program/steps/mail/attachments.inc b/program/steps/mail/attachments.inc
index 601570345..b57037d05 100644
--- a/program/steps/mail/attachments.inc
+++ b/program/steps/mail/attachments.inc
@@ -128,7 +128,13 @@ if (is_array($_FILES['_attachments']['tmp_name'])) {
}
}
else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $OUTPUT->command('display_message', rcube_label('fileuploaderror'), 'error');
+ // if filesize exceeds post_max_size then $_FILES array is empty,
+ // show filesizeerror instead of fileuploaderror
+ if ($maxsize = ini_get('post_max_size'))
+ $msg = rcube_label(array('name' => 'filesizeerror', 'vars' => array('size' => show_bytes(parse_bytes($maxsize)))));
+ else
+ $msg = rcube_label('fileuploaderror');
+ $OUTPUT->command('display_message', $msg, 'error');
}
// send html page with JS calls as response