Technic: Prevent potential HTML injection
This commit is contained in:
parent
d44fa416ca
commit
f267375ac2
@ -202,14 +202,12 @@ void TechnicPage::metadataLoaded()
|
|||||||
QString name = current.name;
|
QString name = current.name;
|
||||||
|
|
||||||
if (current.websiteUrl.isEmpty())
|
if (current.websiteUrl.isEmpty())
|
||||||
// This allows injecting HTML here.
|
text = name.toHtmlEscaped();
|
||||||
text = name;
|
|
||||||
else
|
else
|
||||||
// URL not properly escaped for inclusion in HTML. The name allows for injecting HTML.
|
text = "<a href=\"" + current.websiteUrl.toHtmlEscaped() + "\">" + name.toHtmlEscaped() + "</a>";
|
||||||
text = "<a href=\"" + current.websiteUrl + "\">" + name + "</a>";
|
|
||||||
if (!current.author.isEmpty()) {
|
if (!current.author.isEmpty()) {
|
||||||
// This allows injecting HTML here
|
text += tr(" by ") + current.author.toHtmlEscaped();
|
||||||
text += tr(" by ") + current.author;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->frame->setModText(text);
|
ui->frame->setModText(text);
|
||||||
|
Loading…
Reference in New Issue
Block a user