aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Brun <lorenz@brun.one>2023-09-23 01:40:52 +0200
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-01-31 13:26:04 +0100
commita6f879e154a8ec28f505c369f9f51588531adfdf (patch)
tree494090edbee944a983a12c5933158a02e51995ae
parent7dc5a91f7146c70abec31b6839ba95fd77781ed4 (diff)
downloadnextcloud-server-a6f879e154a8ec28f505c369f9f51588531adfdf.tar.gz
nextcloud-server-a6f879e154a8ec28f505c369f9f51588531adfdf.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>
-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);