Skip to content

Commit

Permalink
Apply htmlentities in a couple of places to prevent xss
Browse files Browse the repository at this point in the history
Co-authored-by: wtwver <wtwver@users.noreply.github.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
  • Loading branch information
PromoFaux and wtwver committed Sep 11, 2021
1 parent c5cfb29 commit 25df783
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/pi-hole/php/func.php
Expand Up @@ -472,6 +472,7 @@ function returnSuccess($message = "", $json = true)

function returnError($message = "", $json = true)
{
$message = htmlentities($message) ;
if ($json) {
return [ "success" => false, "message" => $message ];
} else {
Expand Down
2 changes: 1 addition & 1 deletion settings.php
Expand Up @@ -41,7 +41,7 @@
<button type="button" class="close" data-hide="alert" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h4><i class="icon fa fa-exclamation-triangle"></i> Debug</h4>
<pre><?php print_r($_POST); ?></pre>
<pre><?php print_r(htmlentities($_POST)); ?></pre>
</div>
<?php } ?>

Expand Down

0 comments on commit 25df783

Please sign in to comment.