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

@ -271,14 +271,15 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
m_history = history;
if (history) {
setHeadline(QString("%1 > %2").arg(parentName, tr("Entry history")));
setHeadline(QString("%1 > %2").arg(parentName.toHtmlEscaped(), tr("Entry history")));
}
else {
if (create) {
setHeadline(QString("%1 > %2").arg(parentName, tr("Add entry")));
setHeadline(QString("%1 > %2").arg(parentName.toHtmlEscaped(), tr("Add entry")));
}
else {
setHeadline(QString("%1 > %2 > %3").arg(parentName, entry->title(), tr("Edit entry")));
setHeadline(QString("%1 > %2 > %3").arg(parentName.toHtmlEscaped(),
entry->title().toHtmlEscaped(), tr("Edit entry")));
}
}