aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-09-09 16:38:24 +0800
committerfanquake <fanquake@gmail.com>2019-09-09 16:51:53 +0800
commit4c329d43a5f99bc38e533e34393c2cc72800368a (patch)
tree9669f98d18c8fa854bf565b2a1d85f91eecb2884 /src/qt/bitcoingui.cpp
parent08bb4c31563505a30a9b7dd8e7ed98966d2c8494 (diff)
parentad52f054f67374dc46e0096d1e2f593d6372a2df (diff)
Merge #16826: Do additional character escaping for wallet names and address labels
ad52f054f67374dc46e0096d1e2f593d6372a2df Escape ampersands (&) in wallet names in Open Wallet menu (Andrew Chow) 2c530ea2ada71ca23fa17bab5023b855515463ef HTML escape address labels in more dialogs and notifications (Andrew Chow) 1770a972d471d2bdb36195ec370b6fc238649f4d HTML escape the wallet name in more dialogs and notifications (Andrew Chow) Pull request description: Fixes some places where wallet names and address labels which contain valid html or other interpreted characters are displayed incorrectly. In the send coins dialog, if the wallet name or the address label contains valid html, then the html would be shown rather than the literal string for the wallet name or label. This PR fixes that so the true name or label is shown. The Open Wallet menu would incorrectly show wallet names with ampersands (`&`). For some reason, Qt removes the first ampersand in a string. So by replacing the first ampersand with 2 ampersands, the correct number of ampersands will be shown. Fixes the HTML escaping issues in #16820 ACKs for top commit: laanwj: Untested ACK, thanks for adding proper escaping, ad52f054f67374dc46e0096d1e2f593d6372a2df fanquake: ACK ad52f054f67374dc46e0096d1e2f593d6372a2df Tree-SHA512: 264bef28a8061c7f43cc30c3e04b361c614ea78b9915e8763c44553c8967131b066db500977fa6130de1f8874b9bba59e630486c58e1e3c5c165555105a6c254
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index de6e1ca00e..c672171cfb 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -375,6 +375,8 @@ void BitcoinGUI::createActions()
for (const std::pair<const std::string, bool>& i : m_wallet_controller->listWalletDir()) {
const std::string& path = i.first;
QString name = path.empty() ? QString("["+tr("default wallet")+"]") : QString::fromStdString(path);
+ // Menu items remove single &. Single & are shown when && is in the string, but only the first occurrence. So replace only the first & with &&
+ name.replace(name.indexOf(QChar('&')), 1, QString("&&"));
QAction* action = m_open_wallet_menu->addAction(name);
if (i.second) {