Properly HTML-escape strings with user-defined contents in message boxes (#247)

* Properly HTML-escape strings with user-defined contents in message boxes, resolves #236

* Also escape group names in EditWidget title
This commit is contained in:
Janek Bevendorff 2017-02-06 20:23:51 +01:00 committed by Jonathan White
parent 7e4592c1e7
commit 75eb0c6951
4 changed files with 11 additions and 9 deletions

View file

@ -246,7 +246,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
QMessageBox::StandardButton result =
MessageBox::question(
this, tr("Close?"),
tr("\"%1\" is in edit mode.\nDiscard changes and close anyway?").arg(dbName),
tr("\"%1\" is in edit mode.\nDiscard changes and close anyway?").arg(dbName.toHtmlEscaped()),
QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel);
if (result == QMessageBox::Cancel) {
return false;
@ -262,7 +262,7 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
QMessageBox::StandardButton result =
MessageBox::question(
this, tr("Save changes?"),
tr("\"%1\" was modified.\nSave changes?").arg(dbName),
tr("\"%1\" was modified.\nSave changes?").arg(dbName.toHtmlEscaped()),
QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes);
if (result == QMessageBox::Yes) {
if (!saveDatabase(db)) {