diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-09-16 16:41:09 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-09-16 20:07:32 +0200 |
commit | 1d9e02ef9b8c62c74bfa8ecc87b656d37a4deb8a (patch) | |
tree | 35a828f29b0894796797b880753177df67734a92 | |
parent | Simplify download process (diff) | |
download | online-libreoffice-7-0.tar.gz online-libreoffice-7-0.zip |
Decode file name when trying to download file
libreoffice-7-0
Simplified download process (ab162b6f9580315700a01c3bc10becd510a2ead4)
introduced a bug. Trying to download file with eg. space in the name
become impossible. This patch decodes the string to fix the issue.
Change-Id: I8e5d98010cf098b889eddcce4ba1ce65367b15d5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102874
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit 87aad0a8bbf86502658ffcf3d0ee053af922d474)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102764
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | wsd/LOOLWSD.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index b1a7da739a..d6c0675a0a 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -2879,7 +2879,10 @@ private: bool foundDownloadId = !url.empty(); - const Path filePath(LOOLWSD::ChildRoot + jailId + JAILED_DOCUMENT_ROOT + url); + std::string decoded; + Poco::URI::decode(url, decoded); + + const Path filePath(LOOLWSD::ChildRoot + jailId + JAILED_DOCUMENT_ROOT + decoded); const std::string filePathAnonym = LOOLWSD::anonymizeUrl(filePath.toString()); if (foundDownloadId && filePath.isAbsolute() && File(filePath).exists()) |