From: dongsheng Date: Mon, 4 May 2009 09:12:55 +0000 (+0000) Subject: "MDL-18520, remove empty path element from file listing" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4a9aff79872e24b90befd0ee27324b7abf2030f7;p=moodle.git "MDL-18520, remove empty path element from file listing" --- 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);