summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-06 15:53:20 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-01-12 14:45:19 +0000
commit7a32b6f247b2cb92373bbce6fc2a314cb043e3bb (patch)
tree920b600816fcf36505b940b42a36d159f8db1b16 /ucb
parent24af10f6c1aaff9fd25e969dd010f798618f2813 (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>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx2
-rw-r--r--ucb/source/ucp/cmis/cmis_url.cxx10
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( ) )