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>
pull/40594/head
Lorenz Brun 2023-09-23 01:40:52 +07:00 committed by John Molakvoæ
parent 7dc5a91f71
commit a6f879e154
1 changed files with 1 additions and 1 deletions

@ -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);