ucb/source/ucp/webdav-curl/webdavresponseparser.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit eb7fecd8ef3c0507ac6f9f60cc25161d84349e93
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Oct 25 17:49:40 2021 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 19:01:02 2021 +0100

    ucb: webdav-curl: escape broken SharePoint 2016 URIs
    
    [ reimplement commit 069aa870aadb9f9069e8715c8be30394410f0288 ]
    
    Change-Id: I01a93e3a448e6dc921d1e0471ae01c8ac8feea11
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124218
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx 
b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
index 478e9090990e..9595d42a03b2 100644
--- a/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavresponseparser.cxx
@@ -34,6 +34,7 @@
 #include <map>
 #include <unordered_map>
 #include <rtl/ref.hxx>
+#include <rtl/uri.hxx>
 #include <sal/log.hxx>
 
 using namespace com::sun::star;
@@ -551,7 +552,13 @@ namespace
                                 // href end, save it if we have whitespace
                                 if(whitespaceIsAvailable())
                                 {
-                                    maHref = mpContext->getWhiteSpace();
+                                    // Sharepoint 2016 workaround: apparently
+                                    // the result is an IRI (RFC 3987 
possibly?)
+                                    // so try to encode the non-ASCII chars
+                                    // without changing anything else
+                                    maHref = 
::rtl::Uri::encode(mpContext->getWhiteSpace(),
+                                            rtl_UriCharClassUric, 
rtl_UriEncodeKeepEscapes,
+                                            RTL_TEXTENCODING_UTF8);
                                 }
                                 break;
                             }

Reply via email to