aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-01-29 14:19:16 +0100
committerGravatar GitHub <noreply@github.com> 2022-01-29 14:19:16 +0100
commit8808fb4545d467f62fc82886d9f86bc63c8cf962 (patch)
tree98677be799a08841b03c956f97ce966353ea3a2c /app/Models/Context.php
parent2e805f8c0b3d2c84755219f64aa5ae82eed3c73f (diff)
Fix keep state after favourites tags (#4178)
* Fix keep state after favourites tags #fix https://github.com/FreshRSS/FreshRSS/issues/4124 regression * Optimisation
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php15
1 files changed, 11 insertions, 4 deletions
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);