Skip to content

Commit

Permalink
Properly html-escape labels
Browse files Browse the repository at this point in the history
  • Loading branch information
laanwj committed Jul 31, 2011
1 parent a5e1325 commit dedf83a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/qt/sendcoinsdialog.cpp
Expand Up @@ -9,7 +9,7 @@

#include <QMessageBox>
#include <QLocale>
#include <QDebug>
#include <QTextDocument>

SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent),
Expand Down Expand Up @@ -71,7 +71,7 @@ void SendCoinsDialog::on_sendButton_clicked()
QStringList formatted;
foreach(const SendCoinsRecipient &rcp, recipients)
{
formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), rcp.label, rcp.address));
formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address));
}

QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"),
Expand Down
10 changes: 5 additions & 5 deletions src/qt/transactiondesc.cpp
Expand Up @@ -134,7 +134,7 @@ string TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
strHTML += _("<b>To:</b> ");
strHTML += HtmlEscape(address.ToString());
if (!wallet->mapAddressBook[address].empty())
strHTML += _(" (yours, label: ") + wallet->mapAddressBook[address] + ")";
strHTML += _(" (yours, label: ") + HtmlEscape(wallet->mapAddressBook[address]) + ")";
else
strHTML += _(" (yours)");
strHTML += "<br>";
Expand All @@ -157,7 +157,7 @@ string TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
strAddress = wtx.mapValue["to"];
strHTML += _("<b>To:</b> ");
if (wallet->mapAddressBook.count(strAddress) && !wallet->mapAddressBook[strAddress].empty())
strHTML += wallet->mapAddressBook[strAddress] + " ";
strHTML += HtmlEscape(wallet->mapAddressBook[strAddress]) + " ";
strHTML += HtmlEscape(strAddress) + "<br>";
}

Expand Down Expand Up @@ -215,8 +215,8 @@ string TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
{
strHTML += _("<b>To:</b> ");
if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
strHTML += wallet->mapAddressBook[address] + " ";
strHTML += address.ToString();
strHTML += HtmlEscape(wallet->mapAddressBook[address]) + " ";
strHTML += HtmlEscape(address.ToString());
strHTML += "<br>";
}
}
Expand Down Expand Up @@ -303,7 +303,7 @@ string TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
if (ExtractAddress(vout.scriptPubKey, 0, address))
{
if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
strHTML += wallet->mapAddressBook[address] + " ";
strHTML += HtmlEscape(wallet->mapAddressBook[address]) + " ";
strHTML += address.ToString();
}
strHTML = strHTML + " Amount=" + FormatMoney(vout.nValue);
Expand Down

0 comments on commit dedf83a

Please sign in to comment.