Permalink
Browse files

MDL-37014 repository_webdav - strip the server URL from file & folder…

… paths returned by webdav lib (if present)
  • Loading branch information...
1 parent 325e266 commit 8f0019214e8791394901831727bb9c639a36e5ee @davosmith davosmith committed Dec 5, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 repository/webdav/lib.php
View
3 repository/webdav/lib.php
@@ -124,6 +124,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 8f00192

Please sign in to comment.