From 1d37d8c41763009238d18f1e1bc2e0e58befc36d Mon Sep 17 00:00:00 2001 From: Pablo Ferreiro Date: Sun, 13 Feb 2022 22:30:47 +0100 Subject: [PATCH] Fixed trending --- app/Controllers/TrendingController.php | 2 +- app/Helpers/Misc.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Controllers/TrendingController.php b/app/Controllers/TrendingController.php index 3c08594..0558488 100644 --- a/app/Controllers/TrendingController.php +++ b/app/Controllers/TrendingController.php @@ -8,7 +8,7 @@ use App\Helpers\RSS; class TrendingController { static public function get() { - $cursor = Misc::getCursor(); + $cursor = Misc::getTtwid(); $page = $_GET['page'] ?? 0; $api = Misc::api(); $feed = $api->getTrending($cursor, $page); diff --git a/app/Helpers/Misc.php b/app/Helpers/Misc.php index 6a4ea36..940484e 100644 --- a/app/Helpers/Misc.php +++ b/app/Helpers/Misc.php @@ -9,6 +9,10 @@ class Misc { return isset($_GET['cursor']) && is_numeric($_GET['cursor']) ? (int) $_GET['cursor'] : 0; } + static public function getTtwid(): string { + return $_GET['cursor'] ?? ''; + } + static public function url(string $endpoint = '') { return self::env('APP_URL', '') . $endpoint; }