From: dongsheng Date: Tue, 9 Dec 2008 06:52:27 +0000 (+0000) Subject: "MDL-17391, fix file_type_to_ext to class, which should return array all the time" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b933b378e392b6d08f666aecd02cf6bf6f9ef62e;p=moodle.git "MDL-17391, fix file_type_to_ext to class, which should return array all the time" --- diff --git a/lib/filelib.php b/lib/filelib.php index 0df41dcc53..972498d5f2 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -2088,8 +2088,8 @@ class file_type_to_ext { public function get_file_ext($types) { $this->result = array(); if ((is_array($types) && in_array('*', $types)) || - $types == '*') { - return '*'; + $types == '*' || empty($types)) { + return array('*'); } foreach ($types as $key=>$value){ if (strpos($value, '.') !== false) {