diff --git a/lang/en/form.php b/lang/en/form.php index 6344ad5589c1c..165f367c9f754 100644 --- a/lang/en/form.php +++ b/lang/en/form.php @@ -42,7 +42,7 @@ $string['err_rangelength'] = 'You must enter between {$a->format[0]} and {$a->format[1]} characters here.'; $string['err_required'] = 'You must supply a value here.'; $string['err_wrappingwhitespace'] = 'The value must not start or end with whitespace.'; -$string['err_wrongfileextension'] = 'Some files ({$a->wrongfiles}) cannot be uploaded. Only file types {$a->whitelist} are allowed.'; +$string['err_wrongfileextension'] = 'Some files ({$a->wrongfiles}) cannot be uploaded. Only file types {$a->allowlist} are allowed.'; $string['filesofthesetypes'] = 'Accepted file types:'; $string['filetypesany'] = 'All file types'; $string['filetypesnotall'] = 'It is not allowed to select \'All file types\' here'; diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index 8ec10b03e65a8..59fb995ca964d 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -328,9 +328,9 @@ public function validateSubmitValue($value) { } $filetypesutil = new \core_form\filetypes_util(); - $whitelist = $filetypesutil->normalize_file_types($this->_options['accepted_types']); + $allowlist = $filetypesutil->normalize_file_types($this->_options['accepted_types']); - if (empty($whitelist) || $whitelist === ['*']) { + if (empty($allowlist) || $allowlist === ['*']) { // Any file type is allowed, nothing to check here. return; } @@ -344,14 +344,14 @@ public function validateSubmitValue($value) { } foreach ($draftfiles as $file) { - if (!$filetypesutil->is_allowed_file_type($file->filename, $whitelist)) { + if (!$filetypesutil->is_allowed_file_type($file->filename, $allowlist)) { $wrongfiles[] = $file->filename; } } if ($wrongfiles) { $a = array( - 'whitelist' => implode(', ', $whitelist), + 'allowlist' => implode(', ', $allowlist), 'wrongfiles' => implode(', ', $wrongfiles), ); return get_string('err_wrongfileextension', 'core_form', $a); diff --git a/lib/form/filepicker.php b/lib/form/filepicker.php index 35b08fe591261..e10fd46bf0967 100644 --- a/lib/form/filepicker.php +++ b/lib/form/filepicker.php @@ -248,9 +248,9 @@ public function export_for_template(renderer_base $output) { public function validateSubmitValue($value) { $filetypesutil = new \core_form\filetypes_util(); - $whitelist = $filetypesutil->normalize_file_types($this->_options['accepted_types']); + $allowlist = $filetypesutil->normalize_file_types($this->_options['accepted_types']); - if (empty($whitelist) || $whitelist === ['*']) { + if (empty($allowlist) || $allowlist === ['*']) { // Any file type is allowed, nothing to check here. return; } @@ -264,14 +264,14 @@ public function validateSubmitValue($value) { } foreach ($draftfiles->list as $file) { - if (!$filetypesutil->is_allowed_file_type($file->filename, $whitelist)) { + if (!$filetypesutil->is_allowed_file_type($file->filename, $allowlist)) { $wrongfiles[] = $file->filename; } } if ($wrongfiles) { $a = array( - 'whitelist' => implode(', ', $whitelist), + 'allowlist' => implode(', ', $allowlist), 'wrongfiles' => implode(', ', $wrongfiles), ); return get_string('err_wrongfileextension', 'core_form', $a);