[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp
Andras Timar
andras.timar at collabora.com
Mon Feb 19 17:16:02 UTC 2018
wsd/DocumentBroker.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit dde84d17064926f457b6ef7c6ebd9d595ac837b9
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/49919
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index beafe29e..25a495e2 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