aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-01 09:47:10 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-01 09:47:10 +0200
commit53808c6c05a90ad487d770c65e69bc99a2144bae (patch)
tree08102c62d391553c8b913ad0683ffd9d0229567e /app/Models/EntryDAO.php
parentffacdaa57a4725d9aad15c621eda7179e18dcaa4 (diff)
Fix API starred (#5366)
* Fix API starred Fix https://github.com/FreshRSS/FreshRSS/issues/5363 https://github.com/FreshRSS/FreshRSS/commit/c72914bba2363e436574204b3d6093a6f3cfce89#commitcomment-111220080 * Minor type fix * Additional check * Minor syntax change * Forgotten type change
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 4c6bf0641..af89e9c52 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -1201,12 +1201,20 @@ SQL;
/**
* @phpstan-param 'a'|'A'|'s'|'S'|'c'|'f'|'t'|'T'|'ST' $type
* @param int $id category/feed/tag ID
- * @return array<numeric-string>
+ * @return array<numeric-string>|null
*/
public function listIdsWhere(string $type = 'a', int $id = 0, int $state = FreshRSS_Entry::STATE_ALL,
string $order = 'DESC', int $limit = 1, string $firstId = '', ?FreshRSS_BooleanSearch $filters = null): ?array {
+
[$values, $sql] = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filters);
- return $this->fetchColumn($sql, 0, $values);
+ $stm = $this->pdo->prepare($sql);
+ if ($stm !== false && $stm->execute($values) && ($res = $stm->fetchAll(PDO::FETCH_COLUMN, 0)) !== false) {
+ /** @var array<numeric-string> $res */
+ return $res;
+ }
+ $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
+ Minz_Log::error('SQL error ' . __METHOD__ . json_encode($info));
+ return null;
}
/**