Permalink
Browse files

Merge branch 'MDL-35379-22' of git://github.com/FMCorz/moodle into MO…

…ODLE_22_STABLE
  • Loading branch information...
2 parents c5bc146 + 28f6aa7 commit 3b9ed3037f85b3dfc57b310a0de88a74d83876d0 Sam Hemelryk committed Sep 24, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 repository/webdav/lib.php
View
@@ -157,10 +157,14 @@ public function get_listing($path='', $page = '') {
'path'=>$v['href']
);
}
- }else{
- // a file
+ } else {
+ // A file.
$path = rtrim($path,'/');
- $title = urldecode(substr($v['href'], strpos($v['href'], $path)+strlen($path)));
+ if (empty($path)) {
+ $title = urldecode($v['href']);
+ } else {
+ $title = urldecode(substr($v['href'], strpos($v['href'], $path) + strlen($path)));
+ }
$title = basename($title);
$size = !empty($v['getcontentlength'])? $v['getcontentlength']:'';
$files[strtoupper($title)] = array(

0 comments on commit 3b9ed30

Please sign in to comment.