Browse Source

xss protection

Philip Wittamore 9 months ago
parent
commit
2a2a43f3ee
1 changed files with 1 additions and 1 deletions
  1. 1 1
      blog/search.php

+ 1 - 1
blog/search.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 $string = "";
 $string = "";
 if (isset($_POST["s"])) {
 if (isset($_POST["s"])) {
-    $string = $_POST["s"];
+    $string = htmlspecialchars($_POST["s"]);
 }
 }
 ?>
 ?>
 <!doctype html>
 <!doctype html>