Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better checking of existing value, in case it's not in the list

  • Loading branch information...
commit ff4f23fdcc0888ba3253ecb568d6e4aed4361016 1 parent 0fa2146
moodler authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/assignment/mod.html
View
6 mod/assignment/mod.html
@@ -77,14 +77,18 @@
<?
$sizelist = array("10Kb", "50Kb", "100Kb", "500Kb", "1Mb", "2Mb", "5Mb", "10Mb", "20Mb", "50Mb");
$maxsize = get_max_upload_file_size();
+ $sizeinlist = false;
foreach ($sizelist as $size) {
$sizebytes = get_real_size($size);
if ($sizebytes < $maxsize) {
$filesize[$sizebytes] = $size;
}
+ if ($form->maxbytes == $sizebytes) {
+ $sizeinlist = true;
+ }
}
$filesize[$maxsize] = display_size($maxsize);
- if (!$form->maxbytes) {
+ if (!$sizeinlist) {
$form->maxbytes = get_real_size("500K");
}
ksort($filesize, SORT_NUMERIC);
Please sign in to comment.
Something went wrong with that request. Please try again.