fix html injection; thanks to ⬡-49016 for its report

This commit is contained in:
Luke 2025-01-18 15:40:32 +01:00
parent 3d0725135c
commit f376d8ec96
Signed by: notfire
GPG key ID: 440484407AF15DA3
2 changed files with 4 additions and 4 deletions

View file

@ -38,7 +38,7 @@ foreach (array_reverse($rows) as $i){
if ($i["isrespondedto"] === "f" && $i["ispublic"] == "t") {
echo("<div class=\"question\">");
if ($i["iscwed"] === "t") {
echo("<details><summary>cw: " . $i["cw"] . "</summary><span class=\"cwfiller\"></span>");
echo("<details><summary>cw: " . htmlspecialchars($i["cw"]) . "</summary><span class=\"cwfiller\"></span>");
}
echo(htmlspecialchars($i["text"]));
echo("<div class=\"time\">" . $i["time"] . "</div>");
@ -74,4 +74,4 @@ foreach (array_reverse($rows) as $i){
}
}
?>
?>

View file

@ -36,7 +36,7 @@ foreach (array_reverse($rows) as $i){
if ($i["ispublic"] === "t" && $i["isrespondedto"] === "t") {
echo("<div class=\"question\">");
if ($i["iscwed"] === "t") {
echo("<details><summary>cw: " . $i["cw"] . "</summary><span class=\"cwfiller\"></span>");
echo("<details><summary>cw: " . htmlspecialchars($i["cw"]) . "</summary><span class=\"cwfiller\"></span>");
}
echo(htmlspecialchars($i["text"]));
echo("<div class=\"time\">" . $i["time"] . "</div>");
@ -46,4 +46,4 @@ foreach (array_reverse($rows) as $i){
}
}
?>
?>