[Libreoffice-commits] online.git: wsd/LOOLWSD.cpp

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 16 15:32:18 UTC 2020


 wsd/LOOLWSD.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 87aad0a8bbf86502658ffcf3d0ee053af922d474
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 16 16:41:09 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Sep 16 17:31:59 2020 +0200

    Decode file name when trying to download file
    
    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 at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 579267e5e..2e37618d3 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3124,7 +3124,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())


More information about the Libreoffice-commits mailing list