fix the other #defcon spam issue.

(/newthread.php #3) MySQL error: SQL syntax error near '' at line 1
$id is expected to be an int at all times by a lot of the code. May as well ensure it is.
(Also, explicit check for === filter_int's failure condition, because 0 is still false.)
This commit is contained in:
STJrInuyasha 2015-12-30 06:21:14 -08:00
parent 4573b59016
commit 3f5b4145b9

View File

@ -7,8 +7,11 @@
// Awful old legacy thing. Too much code relies on register globals, // Awful old legacy thing. Too much code relies on register globals,
// and doesn't distinguish between _GET and _POST, so we have to do it here. fun // and doesn't distinguish between _GET and _POST, so we have to do it here. fun
$id = filter_int($_POST['id']) ? $_POST['id'] : filter_int($_GET['id']); $id = filter_int($_POST['id']);
if ($id === null)
$id = filter_int($_GET['id']);
if ($id === null)
$id = 0;
// Wait for the midnight backup to finish... // Wait for the midnight backup to finish...
if ((int)date("Gi") < 5) { if ((int)date("Gi") < 5) {