MDL-59507 forms: accepted file types won't allow the .xxx extension

- Modified get_filetypes_browser_data() to exclude this extension.
- Server side form validation blocks this extension too.
This commit is contained in:
Jake Dallimore
2017-09-18 09:03:00 +08:00
parent 91cbdda6af
commit 405cbc09ba
+6
View File
@@ -323,6 +323,10 @@ class filetypes_util {
$others = [];
foreach (core_filetypes::get_types() as $extension => $info) {
// Reserved for unknown file types. Not available here.
if ($extension === 'xxx') {
continue;
}
$extension = '.'.$extension;
if ($onlytypes && !$this->is_whitelisted($extension, $onlytypes)) {
continue;
@@ -496,6 +500,8 @@ class filetypes_util {
if ($type === '*') {
// Any file is considered as a known type.
continue;
} else if ($type === '.xxx') {
$unknown[$type] = true;
} else if ($this->is_filetype_group($type)) {
// The type is a group that exists.
continue;