diff options
| author | 2023-04-07 00:13:49 +0200 | |
|---|---|---|
| committer | 2023-04-07 00:13:49 +0200 | |
| commit | 6c01e4e7d6c177ac345c826059e585bffdd1d517 (patch) | |
| tree | 45bd8ee233a306881ed81447a3f56ca224fed538 /app/layout | |
| parent | 2118448133e327294ad2b69ed8736bc29879103d (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/layout')
| -rw-r--r-- | app/layout/aside_feed.phtml | 8 | ||||
| -rw-r--r-- | app/layout/header.phtml | 12 | ||||
| -rw-r--r-- | app/layout/layout.phtml | 2 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 12 |
4 files changed, 17 insertions, 17 deletions
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 0de0cadf6..4745b6273 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -8,8 +8,8 @@ $class = ' state_unread'; } - $state_filter_manual = Minz_Request::param('state', ''); - if ($state_filter_manual != '') { + $state_filter_manual = Minz_Request::paramString('state'); + if ($state_filter_manual !== '') { $state_filter_manual = '&state=' . $state_filter_manual; } ?> @@ -164,8 +164,8 @@ <?php } ?> <li class="item link website"><a target="_blank" rel="noreferrer" href="http://example.net/"><?= _t('gen.action.see_website') ?></a></li> <?php if (FreshRSS_Auth::hasAccess()) { - $get = Minz_Request::param('get'); - if (!$get) { + $get = Minz_Request::paramString('get'); + if ($get === '') { $url = _url('subscription', 'feed', 'id', '------', 'from', $actual_view); } else { $url = _url('subscription', 'feed', 'id', '------', 'get', $get, 'from', $actual_view); diff --git a/app/layout/header.phtml b/app/layout/header.phtml index dabdff051..f2330431b 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -24,18 +24,18 @@ <input type="hidden" name="a" value="<?= $param_a ?>" /> <?php } ?> - <?php $get = Minz_Request::param('get', ''); ?> - <?php if ($get != '') { ?> + <?php $get = Minz_Request::paramString('get'); ?> + <?php if ($get !== '') { ?> <input type="hidden" name="get" value="<?= $get ?>" /> <?php } ?> - <?php $order = Minz_Request::param('order', ''); ?> - <?php if ($order != '') { ?> + <?php $order = Minz_Request::paramString('order'); ?> + <?php if ($order !== '') { ?> <input type="hidden" name="order" value="<?= $order ?>" /> <?php } ?> - <?php $state = Minz_Request::param('state', ''); ?> - <?php if ($state != '') { ?> + <?php $state = Minz_Request::paramString('state'); ?> + <?php if ($state !== '') { ?> <input type="hidden" name="state" value="<?= $state ?>" /> <?php } ?> diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index f0ade992f..c8cea2db8 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -55,7 +55,7 @@ if (_t('gen.dir') === 'rtl') { </head> <body class="<?= Minz_Request::actionName() ?><?= (FreshRSS_Context::$user_conf->darkMode === 'no') ? '' : ' darkMode_' . FreshRSS_Context::$user_conf->darkMode ?>"> <?php - if (!Minz_Request::param('ajax')) { + if (!Minz_Request::paramBoolean('ajax')) { flush(); $this->partial('header'); } diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 5b6919f9b..8eb8d4a62 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -44,18 +44,18 @@ <input type="hidden" name="a" value="<?= $param_a ?>" /> <?php } ?> - <?php $get = Minz_Request::param('get', ''); ?> - <?php if ($get != '') { ?> + <?php $get = Minz_Request::paramString('get'); ?> + <?php if ($get !== '') { ?> <input type="hidden" name="get" value="<?= $get ?>" /> <?php } ?> - <?php $order = Minz_Request::param('order', ''); ?> - <?php if ($order != '') { ?> + <?php $order = Minz_Request::paramString('order'); ?> + <?php if ($order !== '') { ?> <input type="hidden" name="order" value="<?= $order ?>" /> <?php } ?> - <?php $state = Minz_Request::param('state', ''); ?> - <?php if ($state != '') { ?> + <?php $state = Minz_Request::paramString('state'); ?> + <?php if ($state !== '') { ?> <input type="hidden" name="state" value="<?= $state ?>" /> <?php } ?> |
