Skip to content

Commit

Permalink
Better protection against SQL injection
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebharris committed Jun 25, 2018
1 parent 96a0af6 commit b26ac64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}

$link = $result->fetch_array(MYSQLI_ASSOC);
$query = "UPDATE short_links SET count = count + 1, last_request = NOW() WHERE id = " . $link["id"];
$query = sprintf("UPDATE short_links SET count = count + 1, last_request = NOW() WHERE id = ''%s''", $link["id"]);

$result = $mysqli->query($query);

Expand Down

0 comments on commit b26ac64

Please sign in to comment.