]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-15351, fixed undefined path variable"
authordongsheng <dongsheng>
Wed, 3 Jun 2009 08:38:52 +0000 (08:38 +0000)
committerdongsheng <dongsheng>
Wed, 3 Jun 2009 08:38:52 +0000 (08:38 +0000)
repository/local/repository.class.php

index 38d2f0efd4e33da6101a92d69d555023356857a9..3d588239c0470947e3c2058bb283d3fea750f9f4 100755 (executable)
@@ -108,8 +108,10 @@ class repository_local extends repository {
                     $path[] = array('name'=>$level->get_visible_name(), 'path'=>$params);
                     $level = $level->get_parent();
                 }
-                $path = array_reverse($path);
-                $ret['path'] = $path;
+                if (!empty($path) && is_array($path)) {
+                    $path = array_reverse($path);
+                    $ret['path'] = $path;
+                }
                 $children = $fileinfo->get_children();
                 foreach ($children as $child) {
                     if ($child->is_directory()) {