aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorLorenz Brun <lorenz@brun.one>2023-09-23 01:40:52 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-02-03 15:29:18 +0100
commit745b6970bb4d7b93adee42ce4bc5570cb5189997 (patch)
treec64f28b985cdd961e8c9d28ad924a3a12f289376 /lib/private/Files
parentd0295750b9c07a22fcea2f8cfbcbf23c0132c1a4 (diff)
downloadnextcloud-server-745b6970bb4d7b93adee42ce4bc5570cb5189997.tar.gz
nextcloud-server-745b6970bb4d7b93adee42ce4bc5570cb5189997.zip
dav: fix wrong decoding of pluses in URLs
PHP's urldecode function does not decode URLs according to RFC 3986, but according to the HTML 4.01 query parameter encoding. This results in pluses being wrongly decoded to spaces even though they should not be decoded at all. Use rawurldecode instead, which follows RFC 3986 properly. This fixes an issue where files on DAV shares containing pluses were incorrectly decoded to spaces. Fixes: #15849 Signed-off-by: Lorenz Brun <lorenz@brun.one>
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Storage/DAV.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index 35add2c606b..e5bbbb560da 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -921,7 +921,7 @@ class DAV extends Common {
}
foreach ($responses as $file => $response) {
- $file = urldecode($file);
+ $file = rawurldecode($file);
$file = substr($file, strlen($this->root));
$file = $this->cleanPath($file);
$this->statCache->set($file, $response);