aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/statsController.php
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/Controllers/statsController.php
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/Controllers/statsController.php')
-rw-r--r--app/Controllers/statsController.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index c5120f479..cd9a247c4 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -86,12 +86,12 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
* but shows the stats idle page
*/
public function feedAction(): void {
- $id = '' . Minz_Request::param('id', '');
- $ajax = '' . Minz_Request::param('ajax', '');
+ $id = Minz_Request::paramInt('id');
+ $ajax = Minz_Request::paramBoolean('ajax');
if ($ajax) {
- $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => $id, 'from' => 'stats', 'ajax' => $ajax));
+ $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => (string)$id, 'from' => 'stats', 'ajax' => (string)$ajax));
} else {
- $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => $id, 'from' => 'stats'));
+ $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => (string)$id, 'from' => 'stats'));
}
Minz_Request::forward($url_redirect, true);
}
@@ -174,9 +174,9 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
$this->view->idleFeeds = $idleFeeds;
$this->view->feeds = $feed_dao->listFeeds();
- $id = Minz_Request::param('id');
+ $id = Minz_Request::paramInt('id');
$this->view->displaySlider = false;
- if (false !== $id) {
+ if ($id !== 0) {
$this->view->displaySlider = true;
$feedDAO = FreshRSS_Factory::createFeedDao();
$this->view->feed = $feedDAO->searchById($id);
@@ -202,7 +202,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
FreshRSS_View::appendScript(Minz_Url::display('/scripts/vendor/chart.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/vendor/chart.min.js')));
- $id = (int)(Minz_Request::param('id'));
+ $id = Minz_Request::paramInt('id');
if ($id === 0) {
$id = null;
}