Skip to content

Commit

Permalink
get rid of sql injection vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
platzhersh committed May 4, 2021
1 parent 9e5fbfc commit 29522c9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions data/db-handler.php
Expand Up @@ -96,19 +96,8 @@ function addHighscore($name, $score, $level) {
$name_clean = htmlspecialchars($name);
$score_clean = htmlspecialchars($score);

$db->exec('INSERT INTO highscore (name, score, level, date, log_referer, log_user_agent, log_remote_addr, log_remote_host, cheater) '
. 'VALUES ("'
. $name . '", '
. $score . ', '
. $level . ', "'
. $date . '", "'
. $ref .'", "'
. $ua . '", "'
. $remA .'", "'
. $remH . '", "'
. $cheater
.'")'
);
$db->exec('INSERT INTO highscore (name, score, level, date, log_referer, log_user_agent, log_remote_addr, log_remote_host, cheater)VALUES(?,?,?,?,?,?,?,?,?)',$name, $score,$level,$date,$ref,$ua,$remA,$remH,$cheater);


$response['status'] = "success";
$response['level'] = $level;
Expand Down

0 comments on commit 29522c9

Please sign in to comment.