From 7b70cc94e6ff4b3b5f3ac7f76d08c55e2c0264a3 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 7 Dec 2024 10:47:28 -0500 Subject: [PATCH] Fix entry preview rendering HTML * Fixes #11538 - prevent rendering HTML in Title, Password, and URL fields in the entry preview pane. --- src/gui/EntryPreviewWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/EntryPreviewWidget.cpp b/src/gui/EntryPreviewWidget.cpp index 1d7dee006..227e1c934 100644 --- a/src/gui/EntryPreviewWidget.cpp +++ b/src/gui/EntryPreviewWidget.cpp @@ -245,7 +245,7 @@ void EntryPreviewWidget::updateEntryHeaderLine() { Q_ASSERT(m_currentEntry); const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title()); - m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title)); + m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title.toHtmlEscaped())); m_ui->entryIcon->setPixmap(Icons::entryIconPixmap(m_currentEntry, IconSize::Large)); } @@ -305,7 +305,7 @@ void EntryPreviewWidget::setPasswordVisible(bool state) m_ui->entryPasswordLabel->setText(html); } else { // No color - m_ui->entryPasswordLabel->setText(password); + m_ui->entryPasswordLabel->setText(password.toHtmlEscaped()); } } else if (password.isEmpty() && !config()->get(Config::Security_PasswordEmptyPlaceholder).toBool()) { m_ui->entryPasswordLabel->setText(""); @@ -387,7 +387,7 @@ void EntryPreviewWidget::updateEntryGeneralTab() m_ui->entryNotesTextEdit->setFont(Font::defaultFont()); } - m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl()); + m_ui->entryUrlLabel->setRawText(m_currentEntry->displayUrl().toHtmlEscaped()); const QString url = m_currentEntry->url(); if (!url.isEmpty()) { // URL is well formed and can be opened in a browser