From 8808fb4545d467f62fc82886d9f86bc63c8cf962 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 29 Jan 2022 14:19:16 +0100 Subject: Fix keep state after favourites tags (#4178) * Fix keep state after favourites tags #fix https://github.com/FreshRSS/FreshRSS/issues/4124 regression * Optimisation --- app/Models/Context.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index 62dc53774..ce24c8e4c 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -195,16 +195,23 @@ class FreshRSS_Context { } /** - * Return true if the current request targets a feed (and not a category or all articles), false otherwise. + * @return bool true if the current request targets a feed (and not a category or all articles), false otherwise. */ - public static function isFeed() { + public static function isFeed(): bool { return self::$current_get['feed'] != false; } /** - * Return true if $get parameter correspond to the $current_get attribute. + * @return bool true if the current request targets a tag (though not all tags), false otherwise. */ - public static function isCurrentGet($get) { + public static function isTag(): bool { + return self::$current_get['tag'] != false; + } + + /** + * @return bool true if $get parameter correspond to the $current_get attribute. + */ + public static function isCurrentGet($get): bool { $type = $get[0]; $id = substr($get, 2); -- cgit v1.2.3