From 393554c31e40103098d68092c8e498abf3d5c20b Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 16 Jan 2023 11:20:05 +0100 Subject: [PATCH] qml: fix unintended mangling of TX (non-psbt) for QR --- electrum/gui/qml/qeqr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/qeqr.py b/electrum/gui/qml/qeqr.py index 95ce090a1..0f76290bd 100644 --- a/electrum/gui/qml/qeqr.py +++ b/electrum/gui/qml/qeqr.py @@ -127,9 +127,11 @@ class QEQRImageProvider(QQuickImageProvider): def requestImage(self, qstr, size): # Qt does a urldecode before passing the string here # but BIP21 (and likely other uri based specs) requires urlencoding, - # so we re-encode percent-quoted if a 'scheme' is found in the string + # so we re-encode percent-quoted if a known 'scheme' is found in the string + # (unknown schemes might be found when a colon is in a serialized TX, which + # leads to mangling of the tx, so we check for supported schemes.) uri = urllib.parse.urlparse(qstr) - if uri.scheme: + if uri.scheme and uri.scheme in ['bitcoin', 'lightning']: # urlencode request parameters query = urllib.parse.parse_qs(uri.query) query = urllib.parse.urlencode(query, doseq=True, quote_via=urllib.parse.quote)