Skip to content

Commit

Permalink
added mysql real scape (for sql injection protection) on top of jtml …
Browse files Browse the repository at this point in the history
…specialchar(which is for xss hijack protection)
  • Loading branch information
sajed-zarrinpour committed Sep 14, 2024
1 parent 19c61cc commit 367dde3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,15 @@ private static function sanitizer($input)
}
else if($type === 'string')
{
return htmlspecialchars($input);
$mysqli = new \mysqli(
self::$host,
self::$user,
self::$password,
self::$database,
self::$port,
);

return $mysqli->real_escape_string(htmlspecialchars($input));
}

}
Expand Down

0 comments on commit 367dde3

Please sign in to comment.