Skip to content

Commit

Permalink
Sanitize inputs to prevent XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
mullaneywt authored Sep 20, 2019
1 parent 0bfe60b commit c18696e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
$searchTerm=preg_replace("/[[:cntrl:]]/","",$_REQUEST['search']);
//Remove any extra quotes that could get passed in from some funky js or something
$searchTerm=str_replace(array("'",'"'),"",$searchTerm);
# prevent XSS script injection reported by mullaneywt
$searchKey=sanitize($searchKey);
# prevent script injection where we display the searchTerm in the title
# reported by Jacob Senn, Capital One
$searchTerm=sanitize($searchTerm);
Expand Down

0 comments on commit c18696e

Please sign in to comment.