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.casta...@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.surn...@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 <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit 7a32b6f247b2cb92373bbce6fc2a314cb043e3bb) Reviewed-on: https://gerrit.libreoffice.org/21422 Reviewed-by: Giuseppe Castagno <giuseppe.casta...@acca-esse.eu> Reviewed-by: Miklos Vajna <vmik...@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( ) ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits