Skip to content

Commit b26ac64

Browse files
committed
Better protection against SQL injection
1 parent 96a0af6 commit b26ac64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131

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

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

0 commit comments

Comments
 (0)