mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-69050-310-allowlist' of git://github.com/mudrd8mz/moodle into MOODLE_310_STABLE
This commit is contained in:
commit
7db1a61a72
36 changed files with 381 additions and 271 deletions
|
@ -114,10 +114,10 @@ class qtype_essay_question extends question_with_responses {
|
|||
if ($hasattachments) {
|
||||
// Check the filetypes.
|
||||
$filetypesutil = new \core_form\filetypes_util();
|
||||
$whitelist = $filetypesutil->normalize_file_types($this->filetypeslist);
|
||||
$allowlist = $filetypesutil->normalize_file_types($this->filetypeslist);
|
||||
$wrongfiles = array();
|
||||
foreach ($response['attachments']->get_files() as $file) {
|
||||
if (!$filetypesutil->is_allowed_file_type($file->get_filename(), $whitelist)) {
|
||||
if (!$filetypesutil->is_allowed_file_type($file->get_filename(), $allowlist)) {
|
||||
$wrongfiles[] = $file->get_filename();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue