]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-18520, remove empty path element from file listing"
authordongsheng <dongsheng>
Mon, 4 May 2009 09:12:55 +0000 (09:12 +0000)
committerdongsheng <dongsheng>
Mon, 4 May 2009 09:12:55 +0000 (09:12 +0000)
repository/filesystem/repository.class.php

index 2f1c615f5ff3e19f9ad31f93c28a3ca64b719190..e5c2342bf14c60e88c731aaeaead2277e54c42ad 100644 (file)
@@ -69,8 +69,10 @@ class repository_filesystem extends repository {
             $parts = explode('/', $path);
             if (count($parts) > 1) {
                 foreach ($parts as $part) {
-                    $trail .= ('/'.$part);
-                    $list['path'][] = array('name'=>$part, 'path'=>$trail);
+                    if (!empty($part)) {
+                        $trail .= ('/'.$part);
+                        $list['path'][] = array('name'=>$part, 'path'=>$trail);
+                    }
                 }
             } else {
                 $list['path'][] = array('name'=>$path, 'path'=>$path);