mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 01:44:27 +02:00
Merge branch 'MDL-69257-master' of git://github.com/mihailges/moodle
This commit is contained in:
commit
fac0b05ed5
11
h5p/ajax.php
11
h5p/ajax.php
@ -78,6 +78,17 @@ switch ($action) {
|
||||
$token = required_param('token', PARAM_RAW);
|
||||
$contentid = required_param('contentId', PARAM_INT);
|
||||
|
||||
$maxsize = get_max_upload_file_size($CFG->maxbytes);
|
||||
// Check size of each uploaded file and scan for viruses.
|
||||
foreach ($_FILES as $uploadedfile) {
|
||||
$filename = clean_param($uploadedfile['name'], PARAM_FILE);
|
||||
if ($uploadedfile['size'] > $maxsize) {
|
||||
H5PCore::ajaxError(get_string('maxbytesfile', 'error', ['file' => $filename, 'size' => display_size($maxsize)]));
|
||||
return;
|
||||
}
|
||||
\core\antivirus\manager::scan_file($uploadedfile['tmp_name'], $filename, true);
|
||||
}
|
||||
|
||||
$editor->ajax->action(H5PEditorEndpoints::FILES, $token, $contentid);
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user