From 528daad181212f6496558819a18f16991cec825d Mon Sep 17 00:00:00 2001
From: jp9000
Date: Mon, 6 May 2019 07:43:48 -0700
Subject: [PATCH] UI: Use escaped html for about dialog
---
UI/window-basic-about.cpp | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/UI/window-basic-about.cpp b/UI/window-basic-about.cpp
index 150af7df5..eb9ca7b46 100644
--- a/UI/window-basic-about.cpp
+++ b/UI/window-basic-about.cpp
@@ -6,7 +6,6 @@
#include
#include
#include
-#include
using namespace json11;
@@ -90,10 +89,10 @@ void OBSAbout::ShowAbout()
std::string error;
Json json = Json::parse(main->patronJson, error);
const Json::array &patrons = json.array_items();
- std::stringstream text;
+ QString text;
- text << "Top Patreon contributors:
";
- text << "";
+ text += "
Top Patreon contributors:
";
+ text += "";
bool first = true;
bool top = true;
@@ -103,23 +102,26 @@ void OBSAbout::ShowAbout()
int amount = patron["amount"].int_value();
if (top && amount < 10000) {
- text << "
";
+ text += "
";
top = false;
} else if (!first) {
- text << "
";
+ text += "
";
}
+ if (!link.empty()) {
+ text += "";
+ }
+ text += QT_UTF8(name.c_str()).toHtmlEscaped();
if (!link.empty())
- text << "";
- text << name;
- if (!link.empty())
- text << "";
+ text += "";
if (first)
first = false;
}
- ui->textBrowser->setHtml(QT_UTF8(text.str().c_str()));
+ ui->textBrowser->setHtml(text);
}
void OBSAbout::ShowAuthors()