From 23ca6bb77b7aeb87c871e112dade1d2539226535 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Tue, 2 Feb 2021 16:14:04 -0500 Subject: [PATCH] Count articles without offset or limit --- lib/REST/Miniflux/V1.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/REST/Miniflux/V1.php b/lib/REST/Miniflux/V1.php index ffd6c36..e7dad34 100644 --- a/lib/REST/Miniflux/V1.php +++ b/lib/REST/Miniflux/V1.php @@ -1024,7 +1024,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler { } // finally compute the total number of entries match the query, if the query hs a limit or offset if ($c->limit || $c->offset) { - $count = Arsse::$db->articleCount(Arsse::$user->id, $c); + $count = Arsse::$db->articleCount(Arsse::$user->id, (clone $c)->limit(0)->offset(0)); } else { $count = sizeof($out); } @@ -1032,7 +1032,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler { } public static function tokenGenerate(string $user, string $label): string { - // Miniflux produces tokens in base64url alphabet + // Miniflux produces tokenss in base64url alphabet $t = str_replace(["+", "/"], ["-", "_"], base64_encode(random_bytes(self::TOKEN_LENGTH))); return Arsse::$db->tokenCreate($user, "miniflux.login", $t, null, $label); }