From 979b80c5bdf4702446550cd2a9608e1d3d9ce2df Mon Sep 17 00:00:00 2001 From: Ploum Date: Fri, 20 Oct 2023 00:02:35 +0200 Subject: [PATCH] fixes a crash with data:image/svg+xml links --- CHANGELOG | 1 + offutils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index edcda86..1890c5c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,6 +13,7 @@ Changes since beta1 - fixes opening mailto links - fixes existing non-html ressources marked a to_fetch even when not needed (simple and/or confusion) - fixes a crash with RSS feeds without element +- fixes a crash with data:image/svg+xml links - fixes a bug in HTML renderer where some hX element were not closed properly - fixes input in Gemini while online - fixes a crash with invalid URL diff --git a/offutils.py b/offutils.py index dd716cb..34722b0 100644 --- a/offutils.py +++ b/offutils.py @@ -146,7 +146,8 @@ def looks_like_base64(src,baseurl): imgurl = urllib.parse.urljoin(baseurl, imgname) else: #We can’t handle other data:image such as svg for now - imgurl = None + #Url cannot be none so set to the base URL + imgurl = urllib.parse.urljoin(baseurl,"offpunk_does_not_support_inline.svg") else: imgurl = urllib.parse.urljoin(baseurl, imgname) return imgurl,imgdata