Skip to content

Commit

Permalink
Fix XSS in creatures.php, thanks to @gesior
Browse files Browse the repository at this point in the history
Closes #254
  • Loading branch information
slawkens committed May 15, 2024
1 parent 2793c41 commit 02eea95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ function error_handler($errno, $errstr) {
}

function escapeHtml($html) {
return htmlentities($html, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
return htmlspecialchars($html);
}

function displayErrorBoxWithBackButton($errors, $action = null) {
Expand Down
2 changes: 1 addition & 1 deletion system/pages/creatures.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function sort_by_chance($a, $b)
echo '</td></tr>';
echo '</TABLE>';
} else {
echo "Monster with name <b>" . $monster_name . "</b> doesn't exist.";
echo "Monster with name <b>" . htmlspecialchars($monster_name) . "</b> doesn't exist.";
}

//back button
Expand Down

0 comments on commit 02eea95

Please sign in to comment.