ucb/source/ucp/gio/gio_content.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
New commits: commit b95071969d95cbf3d56b53286ccefd4c43033fc1 Author: Julien Nabet <[email protected]> AuthorDate: Sat Jun 18 15:14:33 2022 +0200 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Jun 20 10:05:46 2022 +0200 tdf#128196: filenames containing # get truncated when saving to GVFS + replace getLength() by a call to isEmpty() since we're here Change-Id: I77a318ea3e8ceeeddd6c64cee25aa6700cb3457b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136084 Reviewed-by: Julien Nabet <[email protected]> (cherry picked from commit 2a38c834c8b7712421f1125aa0e382de70767b55) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136122 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 52509a361163..ac88a85cc1dd 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <rtl/uri.hxx> #include <utility> #include <string.h> @@ -1090,8 +1091,13 @@ void Content::transfer( const css::ucb::TransferInfo& aTransferInfo, const css:: if (!sDest.endsWith("/")) { sDest += "/"; } - if (aTransferInfo.NewTitle.getLength()) - sDest += aTransferInfo.NewTitle; + if (!aTransferInfo.NewTitle.isEmpty()) + { + sDest += rtl::Uri::encode( aTransferInfo.NewTitle, + rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ); + } else sDest += OUString::createFromAscii(g_file_get_basename(getGFile()));
