Skip to content

Commit 5e61db6

Browse files
committed
Fix entry preview rendering HTML
* Fixes keepassxreboot#11538 - prevent rendering HTML in Title, Password, and URL fields in the entry preview pane.
1 parent 0cb0373 commit 5e61db6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/gui/EntryPreviewWidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void EntryPreviewWidget::updateEntryHeaderLine()
245245
{
246246
Q_ASSERT(m_currentEntry);
247247
const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title());
248-
m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title));
248+
m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title.toHtmlEscaped()));
249249
m_ui->entryIcon->setPixmap(Icons::entryIconPixmap(m_currentEntry, IconSize::Large));
250250
}
251251

@@ -305,7 +305,7 @@ void EntryPreviewWidget::setPasswordVisible(bool state)
305305
m_ui->entryPasswordLabel->setText(html);
306306
} else {
307307
// No color
308-
m_ui->entryPasswordLabel->setText(password);
308+
m_ui->entryPasswordLabel->setText(password.toHtmlEscaped());
309309
}
310310
} else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) {
311311
m_ui->entryPasswordLabel->setText("");
@@ -387,7 +387,7 @@ void EntryPreviewWidget::updateEntryGeneralTab()
387387
m_ui->entryNotesTextEdit->setFont(Font::defaultFont());
388388
}
389389

390-
m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl());
390+
m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl().toHtmlEscaped());
391391
const QString url = m_currentEntry->url();
392392
if (!url.isEmpty()) {
393393
// URL is well formed and can be opened in a browser

0 commit comments

Comments
 (0)