A free, self-hostable news aggregator…
Fix API starred (#5366)
Alexandre Alapetite53808c6c05a9
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.phpindex 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;}/**diff --git a/p/api/greader.php b/p/api/greader.phpindex 34b74fd19..a28825eb7 100644--- a/p/api/greader.php+++ b/p/api/greader.php@@ -746,7 +746,7 @@ final class GReaderAPI {$entryDAO = FreshRSS_Factory::createEntryDao();$ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, $searches);- if ($ids == null) {+ if ($ids === null) {self::internalServerError();}