From 2875d11939679ec319e5b098a9b85da629781d5c Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 16 Sep 2022 10:53:21 +0300 Subject: tdf#150982: properly unquote (URL-decode) vnd.sun.star.expand payload Similar to what is done in bootstrap_expandUri, expandUnoRcUrl, UrlReference::expand, JavaLoader.expand_url, and is documented in XVndSunStarExpandUrl interface. Change-Id: I92917adb38e42c3926494427e4df2451298033e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140042 Reviewed-by: Stephan Bergmann Tested-by: Mike Kaganski --- pyuno/source/loader/pythonloader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pyuno') diff --git a/pyuno/source/loader/pythonloader.py b/pyuno/source/loader/pythonloader.py index 9a7114aea210..02f901942cbb 100644 --- a/pyuno/source/loader/pythonloader.py +++ b/pyuno/source/loader/pythonloader.py @@ -21,6 +21,7 @@ import unohelper import sys import types import os +from urllib.parse import unquote from com.sun.star.uno import Exception,RuntimeException from com.sun.star.loader import XImplementationLoader from com.sun.star.lang import XServiceInfo @@ -68,7 +69,7 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ): protocol, dependent = splitUrl( url ) if "vnd.sun.star.expand" == protocol: exp = self.ctx.getValueByName( "/singletons/com.sun.star.util.theMacroExpander" ) - url = exp.expandMacros(dependent) + url = exp.expandMacros(unquote(dependent)) protocol,dependent = splitUrl( url ) if DEBUG: -- cgit