From 4a9aff79872e24b90befd0ee27324b7abf2030f7 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Mon, 4 May 2009 09:12:55 +0000 Subject: [PATCH] "MDL-18520, remove empty path element from file listing" --- repository/filesystem/repository.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repository/filesystem/repository.class.php b/repository/filesystem/repository.class.php index 2f1c615f5f..e5c2342bf1 100644 --- a/repository/filesystem/repository.class.php +++ b/repository/filesystem/repository.class.php @@ -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); -- 2.39.5