Fix reports under PHP7.2

You'll need to delete all reports made before applying this patch for it
to work right. However, all reports made after applying this patch will
appear correctly in `mod.php?/reports`.

This closes #300.
This commit is contained in:
Fredrick Brennan 2018-07-27 19:20:38 +08:00
parent 524d48110b
commit be2eafd4fc

View File

@ -332,7 +332,7 @@ if (isset($_POST['delete'])) {
$query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)"); $query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)");
$query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':time', time(), PDO::PARAM_INT);
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
$query->bindValue(':board', $board['uri'], PDO::PARAM_INT); $query->bindValue(':board', $board['uri'], PDO::PARAM_STR);
$query->bindValue(':post', $id, PDO::PARAM_INT); $query->bindValue(':post', $id, PDO::PARAM_INT);
$query->bindValue(':reason', $reason, PDO::PARAM_STR); $query->bindValue(':reason', $reason, PDO::PARAM_STR);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));