diff options
author | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-01-06 15:53:20 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-14 13:38:00 +0000 |
commit | 5290bb4d221051b05f6146ddc4bf2a47ba662655 (patch) | |
tree | 475fc812c8bb3c882f693056ba152bc2853bca25 /ucb | |
parent | 7704b0bd61b622d0186aca43626b37fdf364d397 (diff) |
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@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@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 7a32b6f247b2cb92373bbce6fc2a314cb043e3bb)
Reviewed-on: https://gerrit.libreoffice.org/21422
Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_url.cxx | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 44dba8919213..1e7aa847b97f 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 533ebf2e4b11..103ccad2dbb6 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( ) ) |