From e0c7dd6c4ddc375157b8c20487d63d4b5afd9adc Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 3 Aug 2019 16:37:48 +0100 Subject: [PATCH] keep name percent-encoded MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b Reviewed-on: https://gerrit.libreoffice.org/77007 Reviewed-by: Caolán McNamara Reviewed-by: Michael Stahl Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier Gbp-Pq: Name keep-name-percent-encoded.diff --- scripting/source/pyprov/pythonscript.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py index f1b2bfc75ee..64e1337d642 100644 --- a/scripting/source/pyprov/pythonscript.py +++ b/scripting/source/pyprov/pythonscript.py @@ -219,7 +219,9 @@ class MyUriHelper: # path to the .py file + "$functionname, arguments, etc xStorageUri = self.m_uriRefFac.parse(scriptURI) - sStorageUri = xStorageUri.getName().replace( "|", "/" ); + # getName will apply url-decoding to the name, so encode back + sStorageUri = xStorageUri.getName().replace("%", "%25") + sStorageUri = sStorageUri.replace( "|", "/" ) # path to the .py file, relative to the base sFileUri = sStorageUri[0:sStorageUri.find("$")] -- 2.30.2