forked from leftypol/leftypol
pages.php: skip reports deletion if auto maintenance is disabled
This commit is contained in:
parent
f7fd639d2d
commit
4c1a6d3c57
1 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
$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));
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue