forked from leftypol/leftypol
ReportQueries.php: fix filterReports always returning valid reports
This commit is contained in:
parent
73b2bebe56
commit
02d181f7b8
1 changed files with 3 additions and 3 deletions
|
|
@ -89,7 +89,7 @@ class ReportQueries {
|
|||
// Get the reports without a post.
|
||||
$invalid = [];
|
||||
foreach ($raw_reports as $report) {
|
||||
if (isset($report_posts[$report['board']][$report['post']])) {
|
||||
if (!isset($report_posts[$report['board']][$report['post']])) {
|
||||
$invalid[] = $report;
|
||||
}
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ class ReportQueries {
|
|||
$query = $this->pdo->prepare('SELECT `board`, `post`, `id` FROM `reports`');
|
||||
$query->execute();
|
||||
$raw_reports = $query->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$valid_reports = $this->filterReports($raw_reports, false, null);
|
||||
$valid_reports = $this->filterReports($raw_reports, false);
|
||||
$count = \count($valid_reports);
|
||||
|
||||
return $count;
|
||||
|
|
@ -176,7 +176,7 @@ class ReportQueries {
|
|||
$query = $this->pdo->prepare('SELECT `board`, `post`, `id` FROM `reports`');
|
||||
$query->execute();
|
||||
$raw_reports = $query->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$invalid_reports = $this->filterReports($raw_reports, true, null);
|
||||
$invalid_reports = $this->filterReports($raw_reports, true);
|
||||
|
||||
foreach ($invalid_reports as $report) {
|
||||
$this->deleteReportImpl($report['board'], $report['post']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue