Permalink
Browse files

Merge branch 'MDL-37014_webdav_folders_23' of git://github.com/davosm…

…ith/moodle into MOODLE_23_STABLE
  • Loading branch information...
2 parents 568349f + 4615b7b commit 2ea7723c5353abeaa45d5abbece071f363b98206 @danpoltawski danpoltawski committed Dec 18, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 repository/webdav/lib.php
@@ -120,6 +120,9 @@ public function get_listing($path='', $page = '') {
$v['lastmodified'] = null;
}
+ // Remove the server URL from the path (if present), otherwise links will not work - MDL-37014
+ $server = preg_quote($this->options['webdav_server']);
+ $v['href'] = preg_replace("#https?://{$server}#", '', $v['href']);
// Extracting object title from absolute path
$v['href'] = substr(urldecode($v['href']), strlen($webdavpath));
$title = substr($v['href'], strlen($path));

0 comments on commit 2ea7723

Please sign in to comment.