From 05a1c4599a74850a184e008028a3aaa0af6200b6 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Wed, 23 Jul 2014 21:11:04 +0100 Subject: [PATCH] Added code to catch and remove any / from URI path elements. Changed how URI path has path separators removed to be once the URI is parsed, rather than when it is received by the application. --- src/qt/guiutil.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index b6d6ca09f..cd00f5e4c 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -108,7 +108,10 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out) return false; SendCoinsRecipient rv; - rv.address = uri.path(); + QStringList addressParts = uri.path().split("/", QString::SkipEmptyParts, Qt::CaseSensitive); + rv.address = addressParts.isEmpty() + ? "" + : addressParts.first(); rv.amount = 0; #if QT_VERSION < 0x050000 @@ -171,6 +174,7 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) { uri.replace(0, 11, "dogecoin:"); } + QUrl uriInstance(uri); return parseBitcoinURI(uriInstance, out); }