HTML escape address labels in more dialogs and notifications

This commit is contained in:
Andrew Chow 2019-09-08 16:40:37 -04:00
parent 1770a972d4
commit 2c530ea2ad
2 changed files with 2 additions and 2 deletions

View file

@ -297,7 +297,7 @@ void SendCoinsDialog::on_sendButton_clicked()
{ {
if(rcp.label.length() > 0) // label with address if(rcp.label.length() > 0) // label with address
{ {
recipientElement.append(tr("%1 to '%2'").arg(amount, rcp.label)); recipientElement.append(tr("%1 to '%2'").arg(amount, GUIUtil::HtmlEscape(rcp.label)));
recipientElement.append(QString(" (%1)").arg(address)); recipientElement.append(QString(" (%1)").arg(address));
} }
else // just address else // just address

View file

@ -170,7 +170,7 @@ void WalletView::processNewTransaction(const QModelIndex& parent, int start, int
QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString(); QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();
QModelIndex index = ttm->index(start, 0, parent); QModelIndex index = ttm->index(start, 0, parent);
QString address = ttm->data(index, TransactionTableModel::AddressRole).toString(); QString address = ttm->data(index, TransactionTableModel::AddressRole).toString();
QString label = ttm->data(index, TransactionTableModel::LabelRole).toString(); QString label = GUIUtil::HtmlEscape(ttm->data(index, TransactionTableModel::LabelRole).toString());
Q_EMIT incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label, GUIUtil::HtmlEscape(walletModel->getWalletName())); Q_EMIT incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label, GUIUtil::HtmlEscape(walletModel->getWalletName()));
} }