Merge pull request #53729 from nextcloud/dav-external-url-encoded-root

This commit is contained in:
John Molakvoæ 2025-08-01 09:31:14 +02:00 committed by GitHub
commit 4eee160c15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,7 +116,7 @@ class DAV extends Common {
// inject mock for testing
$this->certManager = \OC::$server->getCertificateManager();
}
$this->root = $parameters['root'] ?? '/';
$this->root = rawurldecode($parameters['root'] ?? '/');
$this->root = '/' . ltrim($this->root, '/');
$this->root = rtrim($this->root, '/') . '/';
} else {
@ -191,7 +191,7 @@ class DAV extends Common {
if ($this->secure) {
$baseUri .= 's';
}
$baseUri .= '://' . $this->host . $this->root;
$baseUri .= '://' . $this->host . $this->encodePath($this->root);
return $baseUri;
}