MDL-53577 repository: Added maxbytes error message

Changing the error message that is displayed to users when they
upload a file that is greater than the maximum upload size. Does not
include all upload cases; focuses on those most used by students.
This commit is contained in:
Ben Tindell 2015-05-04 12:29:32 -05:00 committed by Joseph Inhofer
parent fed66ad9e2
commit a2fb838e82
8 changed files with 54 additions and 9 deletions

View file

@ -191,7 +191,9 @@ class repository_upload extends repository {
}
if (($maxbytes!==-1) && (filesize($_FILES[$elname]['tmp_name']) > $maxbytes)) {
throw new file_exception('maxbytesforfile', $_FILES[$elname]['name']);
$maxbytesdisplay = display_size($maxbytes);
throw new file_exception('maxbytesfile', (object) array('file' => $record->filename,
'size' => $maxbytesdisplay));
}
if (file_is_draft_area_limit_reached($record->itemid, $areamaxbytes, filesize($_FILES[$elname]['tmp_name']))) {