From: dongsheng Date: Wed, 3 Jun 2009 08:38:52 +0000 (+0000) Subject: "MDL-15351, fixed undefined path variable" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=78f7e0c6d8fbcb30f1657370f2b5114f1c00c498;p=moodle.git "MDL-15351, fixed undefined path variable" --- diff --git a/repository/local/repository.class.php b/repository/local/repository.class.php index 38d2f0efd4..3d588239c0 100755 --- a/repository/local/repository.class.php +++ b/repository/local/repository.class.php @@ -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()) {