mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-03-11 22:14:13 +00:00
NOISUE Prevent potential HTML injection
This commit is contained in:
parent
e35f2b6c2c
commit
ddc094b76b
@ -178,14 +178,12 @@ void TechnicPage::metadataLoaded()
|
||||
QString name = current.name;
|
||||
|
||||
if (current.websiteUrl.isEmpty())
|
||||
// This allows injecting HTML here.
|
||||
text = name;
|
||||
text = name.toHtmlEscaped();
|
||||
else
|
||||
// URL not properly escaped for inclusion in HTML. The name allows for injecting HTML.
|
||||
text = "<a href=\"" + current.websiteUrl + "\">" + name + "</a>";
|
||||
text = "<a href=\"" + current.websiteUrl.toHtmlEscaped() + "\">" + name.toHtmlEscaped() + "</a>";
|
||||
|
||||
if (!current.author.isEmpty()) {
|
||||
// This allows injecting HTML here
|
||||
text += tr(" by ") + current.author;
|
||||
text += tr(" by ") + current.author.toHtmlEscaped();
|
||||
}
|
||||
|
||||
text += "<br><br>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user