pages.php: skip reports deletion if auto maintenance is disabled

This commit is contained in:
Zankaria 2024-11-04 23:13:14 +01:00
parent f7fd639d2d
commit 4c1a6d3c57

View file

@ -2919,10 +2919,12 @@ function mod_reports() {
foreach ($reports as $report) {
if (!isset($report_posts[$report['board']][$report['post']])) {
// Invalid report (post has since been deleted)
if ($config['auto_maintenance'] != false) {
$query = prepare("DELETE FROM ``reports`` WHERE `post` = :id AND `board` = :board");
$query->bindValue(':id', $report['post'], PDO::PARAM_INT);
$query->bindValue(':board', $report['board']);
$query->execute() or error(db_error($query));
}
continue;
}