Merge branch 'MDL-37014_webdav_folders' of git://github.com/davosmith/moodle

This commit is contained in:
Dan Poltawski 2012-12-18 14:52:27 +08:00
commit 033b07895c

View file

@ -120,6 +120,9 @@ class repository_webdav extends repository {
$v['lastmodified'] = null; $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 // Extracting object title from absolute path
$v['href'] = substr(urldecode($v['href']), strlen($webdavpath)); $v['href'] = substr(urldecode($v['href']), strlen($webdavpath));
$title = substr($v['href'], strlen($path)); $title = substr($v['href'], strlen($path));