MDL-37014 repository_webdav - strip the server URL from file & folder paths returned by webdav lib (if present)

This commit is contained in:
Davo Smith
2012-12-12 08:55:17 +00:00
parent 325e266e95
commit 8f0019214e
+3
View File
@@ -124,6 +124,9 @@ class repository_webdav extends repository {
$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));