ucb/source/ucp/gio/gio_content.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 2a38c834c8b7712421f1125aa0e382de70767b55
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sat Jun 18 15:14:33 2022 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sun Jun 19 20:42:43 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
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/ucb/source/ucp/gio/gio_content.cxx 
b/ucb/source/ucp/gio/gio_content.cxx
index 44037217882b..fc31965a990f 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()));
 

Reply via email to