Skip to content

Commit

Permalink
Merge pull request #1876 from pi-hole/tweak/xssprevention
Browse files Browse the repository at this point in the history
Apply htmlentities in a couple of places to prevent xss
  • Loading branch information
DL6ER committed Sep 11, 2021
2 parents c5cfb29 + 25df783 commit f526716
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 f526716

Please sign in to comment.