Merge pull request #1770 from patricklodder/1.14.3-url-sanity-check

[qt] only allow https explorer links
This commit is contained in:
Ross Nicoll 2021-02-27 22:59:23 +00:00 committed by GitHub
commit 4ffde07033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,8 +220,9 @@ void TransactionView::setModel(WalletModel *_model)
QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
for (int i = 0; i < listUrls.size(); ++i)
{
QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
if (!host.isEmpty())
QUrl url = QUrl(listUrls[i].trimmed(), QUrl::StrictMode);
QString host = url.host();
if (!host.isEmpty() && url.scheme() == "https")
{
QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
if (i == 0)