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

Conflicts:
	repository/webdav/lib.php
This commit is contained in:
Davo Smith
2012-12-12 08:43:58 +00:00
parent 15b3a4398a
commit a0d9283306
+3
View File
@@ -138,6 +138,9 @@ class repository_webdav extends repository {
$filedate = '';
}
// 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']);
if (!empty($v['resourcetype']) && $v['resourcetype'] == 'collection') {
// a folder
if (ltrim($path, '/') != urldecode(ltrim($v['href'], '/'))) {