From 78f7e0c6d8fbcb30f1657370f2b5114f1c00c498 Mon Sep 17 00:00:00 2001
From: dongsheng <dongsheng>
Date: Wed, 3 Jun 2009 08:38:52 +0000
Subject: [PATCH] "MDL-15351, fixed undefined path variable"

---
 repository/local/repository.class.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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()) {
-- 
2.39.5