[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-1' - wsd/DocumentBroker.cpp

Andras Timar andras.timar at collabora.com
Tue Feb 20 14:33:00 UTC 2018


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

New commits:
commit 3d3349c06f5a462b08c08af78f1f054a453bc5c7
Author: Andras Timar <andras.timar at collabora.com>
Date:   Sun Feb 18 00:24:08 2018 +0100

    wsd: encode '#' character in file name
    
    Change-Id: I4d10f38c9025f18a0d0f0f5599892b436b9d002c
    Reviewed-on: https://gerrit.libreoffice.org/49999
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 38440005..dca3ddfc 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -657,7 +657,11 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
         LOG_INF("SHA1 for DocKey [" << _docKey << "] of [" << localPath << "]: " <<
                 Poco::DigestEngine::digestToHex(sha1.digest()));
 
-        _uriJailed = Poco::URI(Poco::URI("file://"), localPath);
+        // LibreOffice can't open files with '#' in the name
+        std::string localPathEncoded;
+        Poco::URI::encode(localPath,"#",localPathEncoded);
+        _uriJailed = Poco::URI(Poco::URI("file://"), localPathEncoded);
+
         _filename = fileInfo._filename;
 
         // Use the local temp file's timestamp.


More information about the Libreoffice-commits mailing list