Skip to content

Commit

Permalink
Merge branch 'MDL-54830-master' of https://github.com/snake/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao authored and andrewnicols committed Jul 19, 2018
2 parents 98b5b9d + bdd410a commit 1f9964a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion course/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,11 @@ public static function update_courses($courses) {

// Make sure maxbytes are less then CFG->maxbytes.
if (array_key_exists('maxbytes', $course)) {
$course['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $course['maxbytes']);
// We allow updates back to 0 max bytes, a special value denoting the course uses the site limit.
// Otherwise, either use the size specified, or cap at the max size for the course.
if ($course['maxbytes'] != 0) {
$course['maxbytes'] = get_max_upload_file_size($CFG->maxbytes, $course['maxbytes']);
}
}

if (!empty($course['courseformatoptions'])) {
Expand Down

0 comments on commit 1f9964a

Please sign in to comment.