[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - ucb/source

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Thu Jan 14 05:38:28 PST 2016


 ucb/source/ucp/cmis/cmis_content.cxx |    2 +-
 ucb/source/ucp/cmis/cmis_url.cxx     |   10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 5290bb4d221051b05f6146ddc4bf2a47ba662655
Author: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>
Date:   Wed Jan 6 15:53:20 2016 +0100

    Related tdf#96174: save again on Google Drive.
    
    Files can no longer be saved on Google Drive.
    The bug was introduced in 0398e1e3967332c49b6451b5d41bcf0357052d0b.
    
    Google Drive may have user name in the form:
    name.surname at domain.com
    In some places the user name should be escaped before using it.
    
    Change-Id: Idee3e57c0ad1dcbbd517b60c387868bfc706f27e
    Reviewed-on: https://gerrit.libreoffice.org/21198
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 7a32b6f247b2cb92373bbce6fc2a314cb043e3bb)
    Reviewed-on: https://gerrit.libreoffice.org/21422
    Reviewed-by: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 44dba89..1e7aa84 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -2019,7 +2019,7 @@ namespace cmis
                     // TODO Cache the objects
 
                     INetURLObject aURL( m_sURL );
-                    OUString sUser = aURL.GetUser( INetURLObject::NO_DECODE );
+                    OUString sUser = aURL.GetUser( INetURLObject::DECODE_WITH_CHARSET );
 
                     URL aUrl( m_sURL );
                     OUString sPath( m_sObjectPath );
diff --git a/ucb/source/ucp/cmis/cmis_url.cxx b/ucb/source/ucp/cmis/cmis_url.cxx
index 533ebf2..103ccad 100644
--- a/ucb/source/ucp/cmis/cmis_url.cxx
+++ b/ucb/source/ucp/cmis/cmis_url.cxx
@@ -61,13 +61,21 @@ namespace cmis
     OUString URL::asString( )
     {
         OUString sUrl;
+        // Related tdf#96174, can no longer save on Google Drive
+        // the user field may contain characters that need to be escaped according to
+        // RFC3896 userinfo URI field
+        // see <https://tools.ietf.org/html/rfc3986#section-3.2.1>
+        OUString sEncodedUser = ( m_sUser.isEmpty() ?
+                                   OUString() :
+                                   rtl::Uri::encode( m_sUser, rtl_UriCharClassUserinfo,
+                                                     rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8) );
         OUString sEncodedBinding = rtl::Uri::encode(
                 m_sBindingUrl + "#" + m_sRepositoryId,
                 rtl_UriCharClassRelSegment,
                 rtl_UriEncodeKeepEscapes,
                 RTL_TEXTENCODING_UTF8 );
         sUrl = "vnd.libreoffice.cmis://" +
-                ( m_sUser.isEmpty() ? OUString( ) : (m_sUser + "@") ) +
+                ( sEncodedUser.isEmpty() ? OUString( ) : (sEncodedUser + "@") ) +
                 sEncodedBinding;
 
         if ( !m_sPath.isEmpty( ) )


More information about the Libreoffice-commits mailing list