aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-07 00:13:49 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-07 00:13:49 +0200
commit6c01e4e7d6c177ac345c826059e585bffdd1d517 (patch)
tree45bd8ee233a306881ed81447a3f56ca224fed538 /app/views/helpers
parent2118448133e327294ad2b69ed8736bc29879103d (diff)
Use typed access to request parameters (#5267)
* Use typed access to request parameters This was a big source of mixed datatypes in many places * Fix notifications * Fix bookmarkAction
Diffstat (limited to 'app/views/helpers')
-rw-r--r--app/views/helpers/feed/update.phtml10
-rw-r--r--app/views/helpers/javascript_vars.phtml2
2 files changed, 6 insertions, 6 deletions
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 0cd2ec0c3..d4f90d151 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -17,12 +17,12 @@
<?php } ?>
<?php
- $from = Minz_Request::param('from');
- if ($from === false) {
+ $from = Minz_Request::paramString('from');
+ if ($from === '') {
$url = _url('subscription', 'feed', 'id', $this->feed->id(), '#', 'slider');
} else {
- $get = Minz_Request::param('get');
- if (!$get) {
+ $get = Minz_Request::paramString('get');
+ if ($get === '') {
$url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from, '#', 'slider');
} else {
$url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from, 'get', $get, '#', 'slider');
@@ -132,7 +132,7 @@
<button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
<button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
<?php
- if ($from === false) {
+ if ($from === '') {
$url = _url('feed', 'delete', 'id', $this->feed->id());
} else {
$url = _url('feed', 'delete', 'id', $this->feed->id(), 'from', $from);
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 99437c7a6..e108f5a34 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -8,7 +8,7 @@ echo htmlspecialchars(json_encode(array(
'anonymous' => !FreshRSS_Auth::hasAccess(),
'auto_remove_article' => !!FreshRSS_Context::isAutoRemoveAvailable(),
'hide_posts' => !(FreshRSS_Context::$user_conf->display_posts || Minz_Request::actionName() === 'reader'),
- 'display_order' => Minz_Request::param('order', FreshRSS_Context::$user_conf->sort_order),
+ 'display_order' => Minz_Request::paramString('order') ?: FreshRSS_Context::$user_conf->sort_order,
'display_categories' => FreshRSS_Context::$user_conf->display_categories,
'auto_mark_article' => !!$mark['article'],
'auto_mark_site' => !!$mark['site'],