Skip to content

Commit 77509e2

Browse files
committed
htmlspecialchars
1 parent 93608dd commit 77509e2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

resources/lib/UnityHTTPD.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function die(mixed $x = null, bool $show_user = false): never
3737
public static function redirect(?string $dest = null): never
3838
{
3939
$dest ??= pathJoin(CONFIG["site"]["prefix"], $_SERVER["REQUEST_URI"]);
40+
$dest = htmlspecialchars($dest);
4041
header("Location: $dest");
4142
self::errorToUser("Redirect failed, click <a href='$dest'>here</a> to continue.", 302);
4243
self::die();

resources/templates/header.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@
150150
<button onclick=\"this.parentElement.style.display='none';\">×</button>
151151
</div>
152152
",
153-
$level->value,
154-
strip_tags($title),
155-
strip_tags($body)
153+
htmlspecialchars($level->value),
154+
htmlspecialchars($title),
155+
htmlspecialchars($body)
156156
);
157157
}
158158
UnityHTTPD::clearMessages();

0 commit comments

Comments
 (0)