]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-17391, fix file_type_to_ext to class, which should return array all the time"
authordongsheng <dongsheng>
Tue, 9 Dec 2008 06:52:27 +0000 (06:52 +0000)
committerdongsheng <dongsheng>
Tue, 9 Dec 2008 06:52:27 +0000 (06:52 +0000)
lib/filelib.php

index 0df41dcc533056e35154ab9c7874c22159dc89c6..972498d5f25a0ba364105ac92745e8a08bd87350 100644 (file)
@@ -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) {