From 675c56f5799ed92a6aa3a8ad3d3d8d6636f444ec Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 3 May 2023 15:30:18 +0200 Subject: Fix entries count (#5368) Parameters warning with some databases --- app/Models/EntryDAO.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/Models/EntryDAO.php') diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 8d32e86f9..3ef3254b0 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1331,11 +1331,13 @@ SQL; public function count(?int $minPriority = null): int { $sql = 'SELECT COUNT(e.id) AS count FROM `_entry` e'; + $values = []; if ($minPriority !== null) { $sql .= ' INNER JOIN `_feed` f ON e.id_feed=f.id'; $sql .= ' WHERE f.priority > :priority'; + $values[':priority'] = $minPriority; } - $res = $this->fetchColumn($sql, 0, [':priority' => $minPriority]); + $res = $this->fetchColumn($sql, 0, $values); return isset($res[0]) ? (int)($res[0]) : -1; } -- cgit v1.2.3