From f1243871b0afd538eb13bb099b619a0769602279 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 15 Sep 2019 14:30:58 +0800 Subject: [PATCH 1/3] Remove redundant HTML escaping The text widget is already set to plaintext and doing HTML escaping will not give us more security but only makes it harder to read. --- src/gui/properties/propertieswidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index c8aac8f66..02fb5a01f 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -317,7 +317,7 @@ void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent // URL seeds loadUrlSeeds(); - m_ui->labelCreatedByVal->setText(m_torrent->creator().toHtmlEscaped()); + m_ui->labelCreatedByVal->setText(m_torrent->creator()); // List files in torrent m_propListModel->model()->setupModelData(m_torrent->info()); From bab953298bd988ed40e13e2250690a0045ee9466 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 15 Sep 2019 14:35:02 +0800 Subject: [PATCH 2/3] Escape HTML in comment field --- src/gui/addnewtorrentdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index 00a0d1ffc..f1845b15d 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -602,7 +602,7 @@ void AddNewTorrentDialog::setupTreeview() setWindowTitle(m_torrentInfo.name()); // Set torrent information - m_ui->labelCommentData->setText(Utils::Misc::parseHtmlLinks(m_torrentInfo.comment())); + m_ui->labelCommentData->setText(Utils::Misc::parseHtmlLinks(m_torrentInfo.comment().toHtmlEscaped())); m_ui->labelDateData->setText(!m_torrentInfo.creationDate().isNull() ? m_torrentInfo.creationDate().toString(Qt::DefaultLocaleShortDate) : tr("Not available")); // Prepare content tree From fccbc5318a68539795934287fd204ca4092967ad Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 15 Sep 2019 14:54:28 +0800 Subject: [PATCH 3/3] Drop logging level to warning for web seed errors --- src/base/bittorrent/session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 0092509e3..5eb5e1841 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -4165,7 +4165,7 @@ void Session::handleUrlSeedAlert(const lt::url_seed_alert *p) { LogMsg(tr("URL seed lookup failed for URL: '%1', message: %2") .arg(QString::fromStdString(p->server_url()), QString::fromStdString(p->message())) - , Log::CRITICAL); + , Log::WARNING); } void Session::handleListenSucceededAlert(const lt::listen_succeeded_alert *p)