]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-13766/REPOSITORY, deal with filtering empty directory"
authordongsheng <dongsheng>
Thu, 8 Jan 2009 05:12:49 +0000 (05:12 +0000)
committerdongsheng <dongsheng>
Thu, 8 Jan 2009 05:12:49 +0000 (05:12 +0000)
repository/lib.php

index 1999eaa20f66055fcc00b5beb74d962e466337f0..a05c3209063cf08c8a1479887040356dd36d1dc7 100644 (file)
@@ -1466,7 +1466,9 @@ abstract class repository {
         $ext = $ft->get_file_ext($this->supported_filetypes());
         if (isset($value->children)) {
             $pass = true;
-            $value->children = array_filter($value->children, array($this, 'filter'));
+            if (!empty($value->children)) {
+                $value->children = array_filter($value->children, array($this, 'filter'));
+            }
         } else {
             if ($accepted_types == '*' || in_array('*', $accepted_types)) {
                 $pass = true;