Browse Source

qml: fix unintended mangling of TX (non-psbt) for QR

master
Sander van Grieken 3 years ago
parent
commit
393554c31e
  1. 6
      electrum/gui/qml/qeqr.py

6
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)

Loading…
Cancel
Save