aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-11-16 22:43:00 +0100
committerGravatar GitHub <noreply@github.com> 2023-11-16 22:43:00 +0100
commit30c7a61a9b410f023c56ef19b9389a61647d8768 (patch)
treebb58408980ce5b86f1d2b4a9be29d55b2d46dbb1 /app/views/helpers
parentee99e7e2cc228500efc1b539954c0ca6cd4c146d (diff)
Use strict_types (#5830)
* Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views/helpers')
-rw-r--r--app/views/helpers/category/update.phtml5
-rw-r--r--app/views/helpers/configure/query.phtml7
-rw-r--r--app/views/helpers/export/articles.phtml1
-rw-r--r--app/views/helpers/export/opml.phtml1
-rw-r--r--app/views/helpers/extension/configure.phtml1
-rw-r--r--app/views/helpers/extension/details.phtml5
-rw-r--r--app/views/helpers/feed/update.phtml5
-rw-r--r--app/views/helpers/index/normal/entry_bottom.phtml1
-rw-r--r--app/views/helpers/index/normal/entry_header.phtml1
-rw-r--r--app/views/helpers/javascript_vars.phtml3
-rw-r--r--app/views/helpers/logs_pagination.phtml2
-rw-r--r--app/views/helpers/stream-footer.phtml10
12 files changed, 29 insertions, 13 deletions
diff --git a/app/views/helpers/category/update.phtml b/app/views/helpers/category/update.phtml
index a0986ff04..7f8fecbf8 100644
--- a/app/views/helpers/category/update.phtml
+++ b/app/views/helpers/category/update.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<div class="post">
<h2>
<?= $this->category->name() ?>
diff --git a/app/views/helpers/configure/query.phtml b/app/views/helpers/configure/query.phtml
index f8d51c193..0f76bc202 100644
--- a/app/views/helpers/configure/query.phtml
+++ b/app/views/helpers/configure/query.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<div class="post">
<h2><?= $this->query->getName() ?></h2>
@@ -20,7 +23,7 @@
<div class="form-group">
<label class="group-name" for=""><?= _t('conf.query.filter.search') ?></label>
<div class="group-controls">
- <input type="text" id="query_search" name="query[search]" value="<?= htmlspecialchars($this->query->getSearch(), ENT_COMPAT, 'UTF-8') ?>"/>
+ <input type="text" id="query_search" name="query[search]" value="<?= htmlspecialchars($this->query->getSearch()->getRawInput(), ENT_COMPAT, 'UTF-8') ?>"/>
</div>
</div>
<div class="form-group">
diff --git a/app/views/helpers/export/articles.phtml b/app/views/helpers/export/articles.phtml
index 1db627bf7..6903c3c69 100644
--- a/app/views/helpers/export/articles.phtml
+++ b/app/views/helpers/export/articles.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
$username = Minz_User::name() ?? Minz_User::INTERNAL_USER;
diff --git a/app/views/helpers/export/opml.phtml b/app/views/helpers/export/opml.phtml
index 8b067b8ff..2c3e004fc 100644
--- a/app/views/helpers/export/opml.phtml
+++ b/app/views/helpers/export/opml.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @param array<FreshRSS_Feed> $feeds
diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml
index e3a6b1b0c..5cf7f9c0a 100644
--- a/app/views/helpers/extension/configure.phtml
+++ b/app/views/helpers/extension/configure.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
$this->partial('aside_configure');
diff --git a/app/views/helpers/extension/details.phtml b/app/views/helpers/extension/details.phtml
index f200ce0d8..b8d0d784f 100644
--- a/app/views/helpers/extension/details.phtml
+++ b/app/views/helpers/extension/details.phtml
@@ -1,6 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
-
<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+
$name_encoded = urlencode($this->ext_details->getName());
$ext_enabled = $this->ext_details->isEnabled();
if ($ext_enabled) {
diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml
index 680bc2399..af2503256 100644
--- a/app/views/helpers/feed/update.phtml
+++ b/app/views/helpers/feed/update.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<div class="post" id="feed_update">
<h1><?= $this->feed->name() ?></h1>
diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml
index 37a6de042..dba0e44a3 100644
--- a/app/views/helpers/index/normal/entry_bottom.phtml
+++ b/app/views/helpers/index/normal/entry_bottom.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$bottomline_read = FreshRSS_Context::$user_conf->bottomline_read;
$bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite;
diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml
index 4cfb5beda..6a693b0a9 100644
--- a/app/views/helpers/index/normal/entry_header.phtml
+++ b/app/views/helpers/index/normal/entry_header.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$topline_read = FreshRSS_Context::$user_conf->topline_read;
$topline_favorite = FreshRSS_Context::$user_conf->topline_favorite;
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 8ee8a7e21..1798187d0 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
$mark = FreshRSS_Context::$user_conf->mark_when;
$s = FreshRSS_Context::$user_conf->shortcuts;
@@ -15,7 +16,7 @@ echo htmlspecialchars(json_encode(array(
'auto_mark_scroll' => !!$mark['scroll'],
'auto_mark_focus' => !!$mark['focus'],
'auto_load_more' => !!FreshRSS_Context::$user_conf->auto_load_more,
- 'auto_actualize_feeds' => !!Minz_Session::param('actualize_feeds', false),
+ 'auto_actualize_feeds' => Minz_Session::paramBoolean('actualize_feeds'),
'does_lazyload' => !!FreshRSS_Context::$user_conf->lazyload ,
'sides_close_article' => !!FreshRSS_Context::$user_conf->sides_close_article,
'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(),
diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtml
index 349be0760..309a80e6b 100644
--- a/app/views/helpers/logs_pagination.phtml
+++ b/app/views/helpers/logs_pagination.phtml
@@ -1,10 +1,10 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$c = Minz_Request::controllerName();
$a = Minz_Request::actionName();
$params = $_GET;
?>
-
<?php if ($this->nbPage > 1) { ?>
<nav class="nav-pagination nav-list">
<ul class="pagination">
diff --git a/app/views/helpers/stream-footer.phtml b/app/views/helpers/stream-footer.phtml
index 9b61ae44f..41f4315b5 100644
--- a/app/views/helpers/stream-footer.phtml
+++ b/app/views/helpers/stream-footer.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$url_next = Minz_Request::currentRequest();
$url_next['params']['next'] = FreshRSS_Context::$next_id;
@@ -12,15 +13,14 @@
'get' => FreshRSS_Context::currentGet(),
'nextGet' => FreshRSS_Context::$next_get,
'idMax' => FreshRSS_Context::$id_max,
- 'search' => htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES),
+ 'search' => htmlspecialchars_decode(FreshRSS_Context::$search->getRawInput(), ENT_QUOTES),
'state' => FreshRSS_Context::$state,
)
);
-?>
-<?php
-$hasAccess = FreshRSS_Auth::hasAccess();
-if ($hasAccess) { ?>
+ $hasAccess = FreshRSS_Auth::hasAccess();
+ if ($hasAccess) {
+?>
<form id="stream-footer" action="" method="post">
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<?php } else { ?>