[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Mon Nov 25 17:11:01 UTC 2019
wsd/DocumentBroker.cpp | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
New commits:
commit c806acb157fa501a8be872042b534a2f49641e62
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Nov 21 15:29:51 2019 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 25 18:10:42 2019 +0100
tdf#125755: Fix some URI encoding issues
Now the iOS app is able to open a document called A#B?C\D&E❤️F🇨🇭G%AAHÖ.doc.
That is, with ‘#’, ‘?’, and ‘&’ that can mess things up when parsing URIs,
non-ASCII and even non-BMP characters, and an actual percent
character in the file name. Is that a complete enough test case? Will see.
Change-Id: I7fc53eaf8188f633d442d14a7f42814553169c71
Reviewed-on: https://gerrit.libreoffice.org/83395
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
(cherry picked from commit b60ccd60c59efb5a03ea698c0205a8543846d9e2)
Reviewed-on: https://gerrit.libreoffice.org/83664
Tested-by: Aron Budea <aron.budea at collabora.com>
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index d243a338c..7d669e00c 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -86,9 +86,7 @@ void sendLastModificationTime(const std::shared_ptr<Session>& session,
Poco::URI DocumentBroker::sanitizeURI(const std::string& uri)
{
// The URI of the document should be url-encoded.
- std::string decodedUri;
- Poco::URI::decode(uri, decodedUri);
- Poco::URI uriPublic(decodedUri);
+ Poco::URI uriPublic(uri);
if (uriPublic.isRelative() || uriPublic.getScheme() == "file")
{
@@ -805,9 +803,8 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
LOG_INF("SHA1 for DocKey [" << _docKey << "] of [" << LOOLWSD::anonymizeUrl(localPath) << "]: " <<
Poco::DigestEngine::digestToHex(sha1.digest()));
- // LibreOffice can't open files with '#' in the name
std::string localPathEncoded;
- Poco::URI::encode(localPath, "#", localPathEncoded);
+ Poco::URI::encode(localPath, "#?", localPathEncoded);
_uriJailed = Poco::URI(Poco::URI("file://"), localPathEncoded).toString();
_uriJailedAnonym = Poco::URI(Poco::URI("file://"), LOOLWSD::anonymizeUrl(localPathEncoded)).toString();
More information about the Libreoffice-commits
mailing list