diff --git a/app/Http/Controllers/RankingController.php b/app/Http/Controllers/RankingController.php index eba1e2565ae..8aca0decd7a 100644 --- a/app/Http/Controllers/RankingController.php +++ b/app/Http/Controllers/RankingController.php @@ -212,8 +212,8 @@ public function index($mode, $type) $maxResults = $this->maxResults($modeInt, $stats); $maxPages = ceil($maxResults / static::PAGE_SIZE); - // TODO: less repeatedly getting params out of request. - $page = \Number::clamp(get_int(request('cursor.page') ?? request('page') ?? 1), 1, $maxPages); + $params = get_params(\Request::all(), null, ['cursor.page:int', 'page']); + $page = \Number::clamp($params['cursor']['page'] ?? $params['page'] ?? 1, 1, $maxPages); $stats = $stats->limit(static::PAGE_SIZE) ->offset(static::PAGE_SIZE * ($page - 1))