From b933b378e392b6d08f666aecd02cf6bf6f9ef62e Mon Sep 17 00:00:00 2001 From: dongsheng Date: Tue, 9 Dec 2008 06:52:27 +0000 Subject: [PATCH] "MDL-17391, fix file_type_to_ext to class, which should return array all the time" --- lib/filelib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.39.5