From: Michael Tremer Date: Wed, 10 Jan 2024 18:04:59 +0000 (+0000) Subject: wiki: Fix rendering external images X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1f5f64b29691f62740f24c0aa8269e479c535bf;p=ipfire.org.git wiki: Fix rendering external images Signed-off-by: Michael Tremer --- diff --git a/src/backend/wiki.py b/src/backend/wiki.py index 74893435..6ee8de6f 100644 --- a/src/backend/wiki.py +++ b/src/backend/wiki.py @@ -844,6 +844,12 @@ class WikiRenderer(misc.Object): """ + # Try to split query string + url, delimiter, qs = url.partition("?") + + # Parse query arguments + args = urllib.parse.parse_qs(qs) + # Skip any absolute and external URLs if url.startswith("https://") or url.startswith("http://"): return html % { @@ -853,12 +859,6 @@ class WikiRenderer(misc.Object): "args" : args, } - # Try to split query string - url, delimiter, qs = url.partition("?") - - # Parse query arguments - args = urllib.parse.parse_qs(qs) - # Build absolute path url = self.backend.wiki.make_path(self.path, url)