-
Bug
-
Resolution: Fixed
-
Critical
-
2.1, 2.2
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_22_STABLE
-
If you set Administration > Security -> Site policies -> Maximum uploaded file size to sever limit the $CFG>maxbytes setting will be set to 0, this will prevent any file to be uploaded
Check:
https://github.com/moodle/moodle/blob/master/webservice/upload.php#L111 |
if (($_FILES[$fieldname]['size'] > $CFG->maxbytes)) {
|
This will always return true, so you can't upload files
I think this will fix the problem:
if ($CFG->maxbytes && ($_FILES[$fieldname]['size'] > $CFG->maxbytes)) {
|