-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.9.4, 3.0.3, 3.1
-
MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
In versions former than 2.9.4+ I was able to use files from file system repository without any size limitation (eve if the php or the server are limitated). Always been admin.
For example to restore a course packaged in a big file.
I realized than in Moodle 2.9.4+ build 20160211 this was still possible, but in build 20160304 it's not possible anymore.
The steps to reproduce this issue are these:
1.- Create a File system repository
2.- Upload via ftp (or another way) a big course backup file (bigger than the maxbytes value).
3.- Beeing admin go to Courses > Restore course
4.- Select the backup file from repository
5.- Click "Select this file"
6.- The limitation appears
The problem is that line 286 of /repository/repository_ajax.php throwns a file_exception because file size limitation.
I think the problem comes from function get_max_upload_file_size in lib/moodlelib.php
This funcion wasn't used in former versions to check the capability ignorefilesizelimits
Now, if the function receive the parameter USER_CAN_IGNORE_FILE_SIZE_LIMITS the function is returning the upload_max_filesize setting (or 5M by default), what force the limitation even in the file system repository for the admin.
The affected code should be this:
if (! $filesize = ini_get('upload_max_filesize'))
$minimumsize = get_real_size($filesize);
Aftewars the conditions are skipped if USER_CAN_IGNORE_FILE_SIZE_LIMITS is passed to get_max_upload_file_size, so the returned value for limitation is the get_real_size($filesize);
In build 20160211 the returned value was directly USER_CAN_IGNORE_FILE_SIZE_LIMITS , what I think is correct if the user has the capability ignorefilesizelimits.
- duplicates
-
MDL-54785 File System Repository silently obeys maximum file size
-
- Closed
-
- is a regression caused by
-
MDL-44626 Drag n drop upload do not show correct warning message when the size of the file is to big
-
- Closed
-
- will be (partly) resolved by
-
MDL-54785 File System Repository silently obeys maximum file size
-
- Closed
-