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:
Tim Hunt
2010-05-12 12:05:37 +00:00
parent 4434e5f6f8
commit b778784346
3 changed files with 48 additions and 58 deletions
+1 -1
View File
@@ -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 {