fix: handle dav external storage roots with spaces

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2025-06-30 17:52:53 +02:00
parent 26c5166790
commit 6d0119bf8d
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

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;
}