Skip to content
Browse files

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

… paths returned by webdav lib (if present)

Conflicts:
	repository/webdav/lib.php
  • Loading branch information...
1 parent 15b3a43 commit a0d9283306d85bc5b3cc8f94a7f4a4962ccca252 @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
@@ -138,6 +138,9 @@ public function get_listing($path='', $page = '') {
$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'], '/'))) {

0 comments on commit a0d9283

Please sign in to comment.
Something went wrong with that request. Please try again.