64af5b
From 3a827091172b9ce3982323b838ed55d896d585d4 Mon Sep 17 00:00:00 2001
64af5b
From: Stephan Bergmann <sbergman@redhat.com>
64af5b
Date: Sat, 3 Aug 2019 16:37:48 +0100
64af5b
Subject: [PATCH 3/3] keep name percent-encoded
64af5b
MIME-Version: 1.0
64af5b
Content-Type: text/plain; charset=UTF-8
64af5b
Content-Transfer-Encoding: 8bit
64af5b
64af5b
Change-Id: I470c4b24192c3e3c9b556a9bbb3b084359e0033b
64af5b
Reviewed-on: https://gerrit.libreoffice.org/77006
64af5b
Tested-by: Jenkins
64af5b
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
64af5b
Tested-by: Caolán McNamara <caolanm@redhat.com>
64af5b
(cherry picked from commit 315c51731384230194af26b86a976bf5d06c9dcc)
64af5b
Reviewed-on: https://gerrit.libreoffice.org/77090
64af5b
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
64af5b
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
64af5b
---
64af5b
 scripting/source/pyprov/pythonscript.py | 4 +++-
64af5b
 1 file changed, 3 insertions(+), 1 deletion(-)
64af5b
64af5b
diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
64af5b
index f1b2bfc75ee3..64e1337d642e 100644
64af5b
--- a/scripting/source/pyprov/pythonscript.py
64af5b
+++ b/scripting/source/pyprov/pythonscript.py
64af5b
@@ -219,7 +219,9 @@ class MyUriHelper:
64af5b
 
64af5b
             # path to the .py file + "$functionname, arguments, etc
64af5b
             xStorageUri = self.m_uriRefFac.parse(scriptURI)
64af5b
-            sStorageUri = xStorageUri.getName().replace( "|", "/" );
64af5b
+            # getName will apply url-decoding to the name, so encode back
64af5b
+            sStorageUri = xStorageUri.getName().replace("%", "%25")
64af5b
+            sStorageUri = sStorageUri.replace( "|", "/" )
64af5b
 
64af5b
             # path to the .py file, relative to the base
64af5b
             sFileUri = sStorageUri[0:sStorageUri.find("$")]
64af5b
-- 
64af5b
2.21.0
64af5b