mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-53240-master-filetypewidgets' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
39f0cb8b8f
1 changed files with 3 additions and 2 deletions
|
@ -26,6 +26,7 @@ namespace core_form;
|
||||||
|
|
||||||
use core_collator;
|
use core_collator;
|
||||||
use core_filetypes;
|
use core_filetypes;
|
||||||
|
use core_text;
|
||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ class filetypes_util {
|
||||||
// Fix whitespace and normalize the syntax a bit.
|
// Fix whitespace and normalize the syntax a bit.
|
||||||
foreach ($types as $i => $type) {
|
foreach ($types as $i => $type) {
|
||||||
$type = str_replace('*.', '.', $type);
|
$type = str_replace('*.', '.', $type);
|
||||||
$type = strtolower($type);
|
$type = core_text::strtolower($type);
|
||||||
$type = trim($type);
|
$type = trim($type);
|
||||||
|
|
||||||
if ($type === '*') {
|
if ($type === '*') {
|
||||||
|
@ -470,7 +471,7 @@ class filetypes_util {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$haystack = strrev(trim(strtolower($filename)));
|
$haystack = strrev(trim(core_text::strtolower($filename)));
|
||||||
|
|
||||||
foreach ($allowedextensions as $extension) {
|
foreach ($allowedextensions as $extension) {
|
||||||
if (strpos($haystack, strrev($extension)) === 0) {
|
if (strpos($haystack, strrev($extension)) === 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue