"MDL-22583, ignore empty directory"
authorDongsheng Cai <unoter@gmail.com>
Mon, 14 Jun 2010 03:32:17 +0000 (03:32 +0000)
committerDongsheng Cai <unoter@gmail.com>
Mon, 14 Jun 2010 03:32:17 +0000 (03:32 +0000)
repository/local/repository.class.php

index dc69379..57038cb 100755 (executable)
@@ -109,6 +109,10 @@ class repository_local extends repository {
                 foreach ($children as $child) {
                     if ($child->is_directory()) {
                         $params = $child->get_params();
                 foreach ($children as $child) {
                     if ($child->is_directory()) {
                         $params = $child->get_params();
+                        $subdir_children = $child->get_children();
+                        if (empty($subdir_children)) {
+                            continue;
+                        }
                         $encodedpath = base64_encode(serialize($params));
                         // hide user_private area from local plugin, user should
                         // use private file plugin to access private files
                         $encodedpath = base64_encode(serialize($params));
                         // hide user_private area from local plugin, user should
                         // use private file plugin to access private files