moodlelib MDL-19418 fix bugs introduced when converting clean_param to preg.
Aumusingly, one of the bugs was detected by a unit test that was in Moodle 1.9, but which for some reason was not in HEAD. I have tidied up the clean_param unit tests and added a few more.
This commit is contained in:
+1
-1
@@ -496,7 +496,7 @@ function mimeinfo($element, $filename) {
|
||||
$mimeinfo = get_mimetypes_array();
|
||||
}
|
||||
|
||||
if (eregi('\.([a-z0-9]+)$', $filename, $match)) {
|
||||
if (preg_match('/\.([a-zA-Z0-9]+)$/', $filename, $match)) {
|
||||
if (isset($mimeinfo[strtolower($match[1])][$element])) {
|
||||
return $mimeinfo[strtolower($match[1])][$element];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user