From d5d098b1840ac64c27e6ba52d8f53b650075440f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 21 Mar 2019 12:43:25 +0100 Subject: [PATCH] Vfs stores %, # and ? urlencoded, we do the encoding here on a central place --- api/src/WebDAV/Server.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/api/src/WebDAV/Server.php b/api/src/WebDAV/Server.php index 4ce983a635..83781a175a 100644 --- a/api/src/WebDAV/Server.php +++ b/api/src/WebDAV/Server.php @@ -237,9 +237,7 @@ class HTTP_WebDAV_Server $this->uri = $uri . $path_info; // set path - // $_SERVER['PATH_INFO'] is already urldecoded - //$this->path = self::_urldecode($path_info); - // quote '#' (e.g. OpenOffice uses this for lock-files) + // Vfs stores %, # and ? urlencoded, we do the encoding here on a central place $this->path = strtr($path_info,array( '%' => '%25', '#' => '%23', @@ -2185,7 +2183,13 @@ class HTTP_WebDAV_Server $http_header_host = preg_replace("/:80$/", "", $this->_SERVER["HTTP_HOST"]); $url = parse_url($this->_SERVER["HTTP_DESTINATION"]); - $path = urldecode($url["path"]); + // Vfs stores %, # and ? urlencoded, we do the encoding here on a central place + $path = strtr(self::_urldecode($url["path"]), array( + '%' => '%25', + '#' => '%23', + '?' => '%3F', + )); + //error_log(__METHOD__."(".array2string($what).") parse_url(HTTP_DESTINATION=".array2string($this->_SERVER["HTTP_DESTINATION"]).")=".array2string($url)." --> ".array2string($path)); if (isset($url["host"])) { // TODO check url scheme, too