aboutsummaryrefslogtreecommitdiff
path: root/app
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
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')
-rw-r--r--app/Controllers/apiController.php1
-rw-r--r--app/Controllers/authController.php5
-rw-r--r--app/Controllers/categoryController.php1
-rw-r--r--app/Controllers/configureController.php1
-rw-r--r--app/Controllers/entryController.php1
-rw-r--r--app/Controllers/errorController.php6
-rw-r--r--app/Controllers/extensionController.php1
-rw-r--r--app/Controllers/feedController.php1
-rw-r--r--app/Controllers/importExportController.php1
-rw-r--r--app/Controllers/indexController.php1
-rw-r--r--app/Controllers/javascriptController.php1
-rw-r--r--app/Controllers/statsController.php1
-rw-r--r--app/Controllers/subscriptionController.php1
-rw-r--r--app/Controllers/tagController.php1
-rw-r--r--app/Controllers/updateController.php1
-rw-r--r--app/Controllers/userController.php3
-rw-r--r--app/Exceptions/AlreadySubscribedException.php1
-rw-r--r--app/Exceptions/BadUrlException.php1
-rw-r--r--app/Exceptions/ContextException.php2
-rw-r--r--app/Exceptions/DAOException.php1
-rw-r--r--app/Exceptions/EntriesGetterException.php1
-rw-r--r--app/Exceptions/FeedException.php1
-rw-r--r--app/Exceptions/FeedNotAddedException.php1
-rw-r--r--app/Exceptions/ZipException.php1
-rw-r--r--app/Exceptions/ZipMissingException.php1
-rw-r--r--app/FreshRSS.php1
-rw-r--r--app/Mailers/UserMailer.php1
-rw-r--r--app/Models/ActionController.php1
-rw-r--r--app/Models/Auth.php9
-rw-r--r--app/Models/BooleanSearch.php5
-rw-r--r--app/Models/Category.php1
-rw-r--r--app/Models/CategoryDAO.php1
-rw-r--r--app/Models/CategoryDAOSQLite.php1
-rw-r--r--app/Models/Context.php1
-rw-r--r--app/Models/DatabaseDAO.php1
-rw-r--r--app/Models/DatabaseDAOPGSQL.php1
-rw-r--r--app/Models/DatabaseDAOSQLite.php1
-rw-r--r--app/Models/Days.php1
-rw-r--r--app/Models/Entry.php11
-rw-r--r--app/Models/EntryDAO.php1
-rw-r--r--app/Models/EntryDAOPGSQL.php1
-rw-r--r--app/Models/EntryDAOSQLite.php1
-rw-r--r--app/Models/Factory.php1
-rw-r--r--app/Models/Feed.php1
-rw-r--r--app/Models/FeedDAO.php1
-rw-r--r--app/Models/FeedDAOSQLite.php1
-rw-r--r--app/Models/FilterAction.php1
-rw-r--r--app/Models/FormAuth.php1
-rw-r--r--app/Models/Log.php1
-rw-r--r--app/Models/LogDAO.php1
-rw-r--r--app/Models/ReadingMode.php1
-rw-r--r--app/Models/Search.php1
-rw-r--r--app/Models/Share.php1
-rw-r--r--app/Models/StatsDAO.php1
-rw-r--r--app/Models/StatsDAOPGSQL.php1
-rw-r--r--app/Models/StatsDAOSQLite.php1
-rw-r--r--app/Models/SystemConfiguration.php1
-rw-r--r--app/Models/Tag.php1
-rw-r--r--app/Models/TagDAO.php1
-rw-r--r--app/Models/TagDAOPGSQL.php1
-rw-r--r--app/Models/TagDAOSQLite.php1
-rw-r--r--app/Models/Themes.php1
-rw-r--r--app/Models/UserConfiguration.php1
-rw-r--r--app/Models/UserDAO.php1
-rw-r--r--app/Models/UserQuery.php1
-rw-r--r--app/Models/View.php1
-rw-r--r--app/Models/ViewJavascript.php1
-rw-r--r--app/Models/ViewStats.php1
-rw-r--r--app/Services/ExportService.php1
-rw-r--r--app/Services/ImportService.php1
-rw-r--r--app/Utils/feverUtil.php1
-rw-r--r--app/Utils/passwordUtil.php1
-rwxr-xr-xapp/actualize_script.php1
-rw-r--r--app/install.php54
-rw-r--r--app/layout/aside_configure.phtml21
-rw-r--r--app/layout/aside_feed.phtml1
-rw-r--r--app/layout/aside_subscription.phtml3
-rw-r--r--app/layout/header.phtml5
-rw-r--r--app/layout/layout.phtml1
-rw-r--r--app/layout/nav_entries.phtml3
-rw-r--r--app/layout/nav_menu.phtml8
-rw-r--r--app/layout/simple.phtml1
-rw-r--r--app/shares.php1
-rw-r--r--app/views/auth/formLogin.phtml5
-rw-r--r--app/views/auth/index.phtml2
-rw-r--r--app/views/auth/register.phtml5
-rw-r--r--app/views/configure/archiving.phtml2
-rw-r--r--app/views/configure/display.phtml2
-rw-r--r--app/views/configure/integration.phtml10
-rw-r--r--app/views/configure/queries.phtml4
-rw-r--r--app/views/configure/query.phtml1
-rw-r--r--app/views/configure/reading.phtml2
-rw-r--r--app/views/configure/shortcut.phtml2
-rw-r--r--app/views/configure/system.phtml2
-rw-r--r--app/views/entry/bookmark.phtml4
-rw-r--r--app/views/entry/read.phtml1
-rw-r--r--app/views/error/index.phtml5
-rw-r--r--app/views/extension/configure.phtml1
-rw-r--r--app/views/extension/index.phtml2
-rw-r--r--app/views/feed/add.phtml7
-rw-r--r--app/views/feed/contentSelectorPreview.phtml1
-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
-rw-r--r--app/views/importExport/export.phtml6
-rw-r--r--app/views/importExport/index.phtml2
-rw-r--r--app/views/index/about.phtml2
-rw-r--r--app/views/index/global.phtml2
-rw-r--r--app/views/index/logs.phtml7
-rw-r--r--app/views/index/normal.phtml1
-rw-r--r--app/views/index/opml.phtml1
-rw-r--r--app/views/index/reader.phtml1
-rw-r--r--app/views/index/rss.phtml5
-rw-r--r--app/views/index/tos.phtml2
-rw-r--r--app/views/javascript/actualize.phtml1
-rw-r--r--app/views/javascript/nbUnreadsPerFeed.phtml1
-rw-r--r--app/views/javascript/nonce.phtml1
-rw-r--r--app/views/stats/idle.phtml2
-rw-r--r--app/views/stats/index.phtml2
-rw-r--r--app/views/stats/repartition.phtml2
-rw-r--r--app/views/subscription/add.phtml2
-rw-r--r--app/views/subscription/bookmarklet.phtml2
-rw-r--r--app/views/subscription/category.phtml1
-rw-r--r--app/views/subscription/feed.phtml1
-rw-r--r--app/views/subscription/index.phtml2
-rw-r--r--app/views/tag/getTagsForEntry.phtml3
-rw-r--r--app/views/tag/index.phtml2
-rw-r--r--app/views/update/apply.phtml2
-rw-r--r--app/views/update/checkInstall.phtml2
-rw-r--r--app/views/update/index.phtml2
-rw-r--r--app/views/user/details.phtml9
-rw-r--r--app/views/user/manage.phtml2
-rw-r--r--app/views/user/profile.phtml3
-rw-r--r--app/views/user/validateEmail.phtml5
-rw-r--r--app/views/user_mailer/email_need_validation.txt.php5
144 files changed, 255 insertions, 131 deletions
diff --git a/app/Controllers/apiController.php b/app/Controllers/apiController.php
index 52ec53045..7568f9831 100644
--- a/app/Controllers/apiController.php
+++ b/app/Controllers/apiController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This controller manage API-related features.
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php
index 90c9a9e03..73a640748 100644
--- a/app/Controllers/authController.php
+++ b/app/Controllers/authController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This controller handles action about authentication.
@@ -116,11 +117,11 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController {
$limits = FreshRSS_Context::$system_conf->limits;
$this->view->cookie_days = (int)round($limits['cookie_duration'] / 86400, 1);
- $isPOST = Minz_Request::isPost() && !Minz_Session::param('POST_to_GET');
+ $isPOST = Minz_Request::isPost() && !Minz_Session::paramBoolean('POST_to_GET');
Minz_Session::_param('POST_to_GET');
if ($isPOST) {
- $nonce = Minz_Session::param('nonce', '');
+ $nonce = Minz_Session::paramString('nonce');
$username = Minz_Request::paramString('username');
$challenge = Minz_Request::paramString('challenge');
diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php
index 630399bf4..de6399e27 100644
--- a/app/Controllers/categoryController.php
+++ b/app/Controllers/categoryController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle actions relative to categories.
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index dab653ac9..ffba5186f 100644
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle every configuration options.
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index b62214970..1ce490ea1 100644
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle every entry actions.
diff --git a/app/Controllers/errorController.php b/app/Controllers/errorController.php
index fe56b13eb..c3e832cf8 100644
--- a/app/Controllers/errorController.php
+++ b/app/Controllers/errorController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle error page.
@@ -14,8 +15,9 @@ class FreshRSS_error_Controller extends FreshRSS_ActionController {
* - error_logs (default: array())
*/
public function indexAction(): void {
- $code_int = Minz_Session::param('error_code', 404);
- $error_logs = Minz_Session::param('error_logs', []);
+ $code_int = Minz_Session::paramInt('error_code') ?: 404;
+ /** @var array<string> */
+ $error_logs = Minz_Session::paramArray('error_logs');
Minz_Session::_params([
'error_code' => false,
'error_logs' => false,
diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php
index e93ec778f..0158b2f76 100644
--- a/app/Controllers/extensionController.php
+++ b/app/Controllers/extensionController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* The controller to manage extensions.
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index a9cb51416..933f82216 100644
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle every feed actions.
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php
index 8f611bc78..6d37cc465 100644
--- a/app/Controllers/importExportController.php
+++ b/app/Controllers/importExportController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle every import and export actions.
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index cad2e9f85..a1c25e649 100644
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This class handles main actions of FreshRSS.
diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php
index eea8fc233..5d402fa67 100644
--- a/app/Controllers/javascriptController.php
+++ b/app/Controllers/javascriptController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_javascript_Controller extends FreshRSS_ActionController {
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index bb99bc601..6e6a2720f 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle application statistics.
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index 86083ceb0..5566224ef 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle subscription actions.
diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php
index 1a7c81841..13909d522 100644
--- a/app/Controllers/tagController.php
+++ b/app/Controllers/tagController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle every tag actions.
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 6d9249771..43860a50c 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_update_Controller extends FreshRSS_ActionController {
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index aa5682e26..6766182c1 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Controller to handle user actions.
@@ -536,7 +537,7 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController {
$ok = true;
if ($self_deletion) {
// We check the password if it’s a self-destruction
- $nonce = Minz_Session::param('nonce', '');
+ $nonce = Minz_Session::paramString('nonce');
$challenge = Minz_Request::paramString('challenge');
$ok &= FreshRSS_FormAuth::checkCredentials(
diff --git a/app/Exceptions/AlreadySubscribedException.php b/app/Exceptions/AlreadySubscribedException.php
index 410784451..3802e7d65 100644
--- a/app/Exceptions/AlreadySubscribedException.php
+++ b/app/Exceptions/AlreadySubscribedException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_AlreadySubscribed_Exception extends Exception {
diff --git a/app/Exceptions/BadUrlException.php b/app/Exceptions/BadUrlException.php
index 748a619d6..d308d4791 100644
--- a/app/Exceptions/BadUrlException.php
+++ b/app/Exceptions/BadUrlException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_BadUrl_Exception extends FreshRSS_Feed_Exception {
diff --git a/app/Exceptions/ContextException.php b/app/Exceptions/ContextException.php
index d2d29abc0..5d06baf35 100644
--- a/app/Exceptions/ContextException.php
+++ b/app/Exceptions/ContextException.php
@@ -1,6 +1,6 @@
<?php
-
declare(strict_types=1);
+
/**
* An exception raised when a context is invalid
*/
diff --git a/app/Exceptions/DAOException.php b/app/Exceptions/DAOException.php
index 71ed371f8..3f689f318 100644
--- a/app/Exceptions/DAOException.php
+++ b/app/Exceptions/DAOException.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_DAO_Exception extends Exception {
diff --git a/app/Exceptions/EntriesGetterException.php b/app/Exceptions/EntriesGetterException.php
index d145a0ed5..a9f29e034 100644
--- a/app/Exceptions/EntriesGetterException.php
+++ b/app/Exceptions/EntriesGetterException.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_EntriesGetter_Exception extends Exception {
diff --git a/app/Exceptions/FeedException.php b/app/Exceptions/FeedException.php
index 49843f3ed..343aca5d6 100644
--- a/app/Exceptions/FeedException.php
+++ b/app/Exceptions/FeedException.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_Feed_Exception extends Exception {
diff --git a/app/Exceptions/FeedNotAddedException.php b/app/Exceptions/FeedNotAddedException.php
index 4676c8eb3..921cd985b 100644
--- a/app/Exceptions/FeedNotAddedException.php
+++ b/app/Exceptions/FeedNotAddedException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_FeedNotAdded_Exception extends Exception {
diff --git a/app/Exceptions/ZipException.php b/app/Exceptions/ZipException.php
index d02cc1aea..a0664f913 100644
--- a/app/Exceptions/ZipException.php
+++ b/app/Exceptions/ZipException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Zip_Exception extends Exception {
diff --git a/app/Exceptions/ZipMissingException.php b/app/Exceptions/ZipMissingException.php
index 5b4791b1b..c33c1bcb8 100644
--- a/app/Exceptions/ZipMissingException.php
+++ b/app/Exceptions/ZipMissingException.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_ZipMissing_Exception extends Exception {
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index c4f06f63f..c4eaaec1b 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS extends Minz_FrontController {
/**
diff --git a/app/Mailers/UserMailer.php b/app/Mailers/UserMailer.php
index ad634290d..6e54caa4b 100644
--- a/app/Mailers/UserMailer.php
+++ b/app/Mailers/UserMailer.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Manage the emails sent to the users.
diff --git a/app/Models/ActionController.php b/app/Models/ActionController.php
index 1a46cff36..a840ccc6d 100644
--- a/app/Models/ActionController.php
+++ b/app/Models/ActionController.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_ActionController extends Minz_ActionController {
diff --git a/app/Models/Auth.php b/app/Models/Auth.php
index 205b428a2..e5f7fc0b9 100644
--- a/app/Models/Auth.php
+++ b/app/Models/Auth.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This class handles all authentication process.
@@ -20,7 +21,7 @@ class FreshRSS_Auth {
self::removeAccess();
}
- self::$login_ok = Minz_Session::param('loginOk', false);
+ self::$login_ok = Minz_Session::paramBoolean('loginOk');
$current_user = Minz_User::name();
if ($current_user === null) {
$current_user = FreshRSS_Context::$system_conf->default_user;
@@ -109,7 +110,7 @@ class FreshRSS_Auth {
switch (FreshRSS_Context::$system_conf->auth_type) {
case 'form':
- self::$login_ok = Minz_Session::param('passwordHash') === FreshRSS_Context::$user_conf->passwordHash;
+ self::$login_ok = Minz_Session::paramString('passwordHash') === FreshRSS_Context::$user_conf->passwordHash;
break;
case 'http_auth':
$current_user = Minz_User::name();
@@ -212,7 +213,7 @@ class FreshRSS_Auth {
}
public static function csrfToken(): string {
- $csrf = Minz_Session::param('csrf');
+ $csrf = Minz_Session::paramString('csrf');
if ($csrf == '') {
$salt = FreshRSS_Context::$system_conf->salt;
$csrf = sha1($salt . uniqid('' . random_int(0, mt_getrandmax()), true));
@@ -222,7 +223,7 @@ class FreshRSS_Auth {
}
public static function isCsrfOk(?string $token = null): bool {
- $csrf = Minz_Session::param('csrf');
+ $csrf = Minz_Session::paramString('csrf');
if ($token === null) {
$token = $_POST['_csrf'] ?? '';
}
diff --git a/app/Models/BooleanSearch.php b/app/Models/BooleanSearch.php
index d8c47c878..8a750a713 100644
--- a/app/Models/BooleanSearch.php
+++ b/app/Models/BooleanSearch.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Contains Boolean search from the search form.
@@ -67,7 +68,7 @@ class FreshRSS_BooleanSearch {
$name = trim($matches['search'][$i]);
if (!empty($queries[$name])) {
$fromS[] = $matches[0][$i];
- $toS[] = '(' . trim($queries[$name]->getSearch()) . ')';
+ $toS[] = '(' . trim($queries[$name]->getSearch()->getRawInput()) . ')';
}
}
}
@@ -110,7 +111,7 @@ class FreshRSS_BooleanSearch {
$id = (int)(trim($matches['search'][$i])) - 1;
if (!empty($queries[$id])) {
$fromS[] = $matches[0][$i];
- $toS[] = '(' . trim($queries[$id]->getSearch()) . ')';
+ $toS[] = '(' . trim($queries[$id]->getSearch()->getRawInput()) . ')';
}
}
}
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 370c49709..ab08a5b74 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Category extends Minz_Model {
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index 72971f44b..5dfecb36d 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_CategoryDAO extends Minz_ModelPdo {
diff --git a/app/Models/CategoryDAOSQLite.php b/app/Models/CategoryDAOSQLite.php
index ee6d5b7ad..268d579b1 100644
--- a/app/Models/CategoryDAOSQLite.php
+++ b/app/Models/CategoryDAOSQLite.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_CategoryDAOSQLite extends FreshRSS_CategoryDAO {
diff --git a/app/Models/Context.php b/app/Models/Context.php
index 9fac52d44..ac5547aa1 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* The context object handles the current configuration file and different
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php
index 1f31f161a..89327d6c9 100644
--- a/app/Models/DatabaseDAO.php
+++ b/app/Models/DatabaseDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This class is used to test database is well-constructed.
diff --git a/app/Models/DatabaseDAOPGSQL.php b/app/Models/DatabaseDAOPGSQL.php
index 7976d5e14..4a92dd184 100644
--- a/app/Models/DatabaseDAOPGSQL.php
+++ b/app/Models/DatabaseDAOPGSQL.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This class is used to test database is well-constructed.
diff --git a/app/Models/DatabaseDAOSQLite.php b/app/Models/DatabaseDAOSQLite.php
index 261932867..787380637 100644
--- a/app/Models/DatabaseDAOSQLite.php
+++ b/app/Models/DatabaseDAOSQLite.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* This class is used to test database is well-constructed (SQLite).
diff --git a/app/Models/Days.php b/app/Models/Days.php
index d3f1ba075..c445c6355 100644
--- a/app/Models/Days.php
+++ b/app/Models/Days.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_Days {
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 249f607ee..e19a637d7 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Entry extends Minz_Model {
public const STATE_READ = 1;
@@ -437,7 +438,11 @@ HTML;
return $this->hash;
}
- public function _id(string $value): void {
+ /** @param int|string $value String is for compatibility with 32-bit platforms */
+ public function _id($value): void {
+ if (is_int($value)) {
+ $value = (string)$value;
+ }
$this->id = $value;
if ($this->date_added == 0) {
$this->date_added = $value;
@@ -741,11 +746,11 @@ HTML;
}
$content = '';
- $nodes = $xpath->query(new Gt\CssXPath\Translator($path));
+ $nodes = $xpath->query((new Gt\CssXPath\Translator($path))->asXPath());
if ($nodes != false) {
foreach ($nodes as $node) {
if (!empty($attributes['path_entries_filter'])) {
- $filterednodes = $xpath->query(new Gt\CssXPath\Translator($attributes['path_entries_filter']), $node) ?: [];
+ $filterednodes = $xpath->query((new Gt\CssXPath\Translator($attributes['path_entries_filter']))->asXPath(), $node) ?: [];
foreach ($filterednodes as $filterednode) {
$filterednode->parentNode->removeChild($filterednode);
}
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index f2711d448..403f4e493 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_EntryDAO extends Minz_ModelPdo {
diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php
index 0e8ffa463..39e86384d 100644
--- a/app/Models/EntryDAOPGSQL.php
+++ b/app/Models/EntryDAOPGSQL.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite {
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 136f6d550..66feb567b 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
diff --git a/app/Models/Factory.php b/app/Models/Factory.php
index d06c3c63d..eef3c81f5 100644
--- a/app/Models/Factory.php
+++ b/app/Models/Factory.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Factory {
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 38c6ca37e..d94763e6e 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Feed extends Minz_Model {
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index ef9db1e01..42a4e77f1 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_FeedDAO extends Minz_ModelPdo {
diff --git a/app/Models/FeedDAOSQLite.php b/app/Models/FeedDAOSQLite.php
index 32d5bd0d2..c6bf9c8ae 100644
--- a/app/Models/FeedDAOSQLite.php
+++ b/app/Models/FeedDAOSQLite.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO {
diff --git a/app/Models/FilterAction.php b/app/Models/FilterAction.php
index bd8b12a7a..6487d5100 100644
--- a/app/Models/FilterAction.php
+++ b/app/Models/FilterAction.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_FilterAction {
diff --git a/app/Models/FormAuth.php b/app/Models/FormAuth.php
index c19856c37..83fb60e3c 100644
--- a/app/Models/FormAuth.php
+++ b/app/Models/FormAuth.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_FormAuth {
public static function checkCredentials(string $username, string $hash, string $nonce, string $challenge): bool {
diff --git a/app/Models/Log.php b/app/Models/Log.php
index c3f4bb244..7760e76ca 100644
--- a/app/Models/Log.php
+++ b/app/Models/Log.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_Log extends Minz_Model {
diff --git a/app/Models/LogDAO.php b/app/Models/LogDAO.php
index 080af54ea..9d271455e 100644
--- a/app/Models/LogDAO.php
+++ b/app/Models/LogDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
final class FreshRSS_LogDAO {
public static function logPath(?string $logFileName = null): string {
diff --git a/app/Models/ReadingMode.php b/app/Models/ReadingMode.php
index 51ff26fd5..c8ebe66f3 100644
--- a/app/Models/ReadingMode.php
+++ b/app/Models/ReadingMode.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Manage the reading modes in FreshRSS.
diff --git a/app/Models/Search.php b/app/Models/Search.php
index 56f8d3834..d5dd701c3 100644
--- a/app/Models/Search.php
+++ b/app/Models/Search.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
require_once(LIB_PATH . '/lib_date.php');
diff --git a/app/Models/Share.php b/app/Models/Share.php
index b0665a07c..57177c78c 100644
--- a/app/Models/Share.php
+++ b/app/Models/Share.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Manage the sharing options in FreshRSS.
diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php
index 122ca14a8..2cef6c183 100644
--- a/app/Models/StatsDAO.php
+++ b/app/Models/StatsDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_StatsDAO extends Minz_ModelPdo {
diff --git a/app/Models/StatsDAOPGSQL.php b/app/Models/StatsDAOPGSQL.php
index 6e0e04c60..5204b04e3 100644
--- a/app/Models/StatsDAOPGSQL.php
+++ b/app/Models/StatsDAOPGSQL.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_StatsDAOPGSQL extends FreshRSS_StatsDAO {
diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php
index 7d5be10c0..2aa86f0da 100644
--- a/app/Models/StatsDAOSQLite.php
+++ b/app/Models/StatsDAOSQLite.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_StatsDAOSQLite extends FreshRSS_StatsDAO {
diff --git a/app/Models/SystemConfiguration.php b/app/Models/SystemConfiguration.php
index bf5bed0d7..294ca1e3a 100644
--- a/app/Models/SystemConfiguration.php
+++ b/app/Models/SystemConfiguration.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
/**
diff --git a/app/Models/Tag.php b/app/Models/Tag.php
index 920422ac8..0e50763d0 100644
--- a/app/Models/Tag.php
+++ b/app/Models/Tag.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Tag extends Minz_Model {
diff --git a/app/Models/TagDAO.php b/app/Models/TagDAO.php
index a89c04695..bd52223a8 100644
--- a/app/Models/TagDAO.php
+++ b/app/Models/TagDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_TagDAO extends Minz_ModelPdo {
diff --git a/app/Models/TagDAOPGSQL.php b/app/Models/TagDAOPGSQL.php
index 1b8bb7784..de3b20f92 100644
--- a/app/Models/TagDAOPGSQL.php
+++ b/app/Models/TagDAOPGSQL.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
class FreshRSS_TagDAOPGSQL extends FreshRSS_TagDAO {
diff --git a/app/Models/TagDAOSQLite.php b/app/Models/TagDAOSQLite.php
index f1921c9f0..efa52807a 100644
--- a/app/Models/TagDAOSQLite.php
+++ b/app/Models/TagDAOSQLite.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_TagDAOSQLite extends FreshRSS_TagDAO {
diff --git a/app/Models/Themes.php b/app/Models/Themes.php
index 902d3c94b..53ae1dc27 100644
--- a/app/Models/Themes.php
+++ b/app/Models/Themes.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_Themes extends Minz_Model {
diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php
index 1eceaab99..05e36aae6 100644
--- a/app/Models/UserConfiguration.php
+++ b/app/Models/UserConfiguration.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
/**
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php
index 0961da82e..1f85b5fe9 100644
--- a/app/Models/UserDAO.php
+++ b/app/Models/UserDAO.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_UserDAO extends Minz_ModelPdo {
diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php
index 3454ede31..85df49f1c 100644
--- a/app/Models/UserQuery.php
+++ b/app/Models/UserQuery.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Contains the description of a user query
diff --git a/app/Models/View.php b/app/Models/View.php
index b8d776fbc..17772a2ec 100644
--- a/app/Models/View.php
+++ b/app/Models/View.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_View extends Minz_View {
diff --git a/app/Models/ViewJavascript.php b/app/Models/ViewJavascript.php
index 157ebe4ae..38a0a74f0 100644
--- a/app/Models/ViewJavascript.php
+++ b/app/Models/ViewJavascript.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
final class FreshRSS_ViewJavascript extends FreshRSS_View {
diff --git a/app/Models/ViewStats.php b/app/Models/ViewStats.php
index f07c19c91..25c749cd2 100644
--- a/app/Models/ViewStats.php
+++ b/app/Models/ViewStats.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
final class FreshRSS_ViewStats extends FreshRSS_View {
diff --git a/app/Services/ExportService.php b/app/Services/ExportService.php
index 80531f3fc..c44b2bf4b 100644
--- a/app/Services/ExportService.php
+++ b/app/Services/ExportService.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Provide useful methods to generate files to export.
diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php
index 9b013fea4..e210d0fd7 100644
--- a/app/Services/ImportService.php
+++ b/app/Services/ImportService.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* Provide methods to import files.
diff --git a/app/Utils/feverUtil.php b/app/Utils/feverUtil.php
index c581cd5c4..3c2b8bd2e 100644
--- a/app/Utils/feverUtil.php
+++ b/app/Utils/feverUtil.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_fever_Util {
private const FEVER_PATH = DATA_PATH . '/fever';
diff --git a/app/Utils/passwordUtil.php b/app/Utils/passwordUtil.php
index 4e3040f4a..47587d336 100644
--- a/app/Utils/passwordUtil.php
+++ b/app/Utils/passwordUtil.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
class FreshRSS_password_Util {
// Will also have to be computed client side on mobile devices,
diff --git a/app/actualize_script.php b/app/actualize_script.php
index 93479e74d..cfe897bdd 100755
--- a/app/actualize_script.php
+++ b/app/actualize_script.php
@@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php
+declare(strict_types=1);
require(__DIR__ . '/../cli/_cli.php');
session_cache_limiter('');
diff --git a/app/install.php b/app/install.php
index b811f0de7..348ba079b 100644
--- a/app/install.php
+++ b/app/install.php
@@ -1,4 +1,6 @@
<?php
+declare(strict_types=1);
+
if (function_exists('opcache_reset')) {
opcache_reset();
}
@@ -27,15 +29,15 @@ function initTranslate(): void {
Minz_Translate::init();
$available_languages = Minz_Translate::availableLanguages();
- if (Minz_Session::param('language') == '') {
+ if (Minz_Session::paramString('language') == '') {
Minz_Session::_param('language', get_best_language());
}
- if (!in_array(Minz_Session::param('language'), $available_languages, true)) {
+ if (!in_array(Minz_Session::paramString('language'), $available_languages, true)) {
Minz_Session::_param('language', 'en');
}
- Minz_Translate::reset(Minz_Session::param('language'));
+ Minz_Translate::reset(Minz_Session::paramString('language'));
}
function get_best_language(): string {
@@ -91,7 +93,7 @@ function saveStep1(): void {
function saveStep2(): void {
if (!empty($_POST)) {
- if (Minz_Session::param('bd_type') === 'sqlite') {
+ if (Minz_Session::paramString('bd_type') === 'sqlite') {
Minz_Session::_params([
'bd_base' => false,
'bd_host' => false,
@@ -114,8 +116,8 @@ function saveStep2(): void {
'bd_prefix' => substr($_POST['prefix'], 0, 16),
]);
}
- if (Minz_Session::param('bd_type') === 'pgsql') {
- Minz_Session::_param('bd_base', strtolower(Minz_Session::param('bd_base')));
+ if (Minz_Session::paramString('bd_type') === 'pgsql') {
+ Minz_Session::_param('bd_base', strtolower(Minz_Session::paramString('bd_base')));
}
// We use dirname to remove the /i part
@@ -125,18 +127,18 @@ function saveStep2(): void {
'base_url' => $base_url,
'default_user' => '_',
'db' => [
- 'type' => Minz_Session::param('bd_type'),
- 'host' => Minz_Session::param('bd_host'),
- 'user' => Minz_Session::param('bd_user'),
- 'password' => Minz_Session::param('bd_password'),
- 'base' => Minz_Session::param('bd_base'),
- 'prefix' => Minz_Session::param('bd_prefix'),
+ 'type' => Minz_Session::paramString('bd_type'),
+ 'host' => Minz_Session::paramString('bd_host'),
+ 'user' => Minz_Session::paramString('bd_user'),
+ 'password' => Minz_Session::paramString('bd_password'),
+ 'base' => Minz_Session::paramString('bd_base'),
+ 'prefix' => Minz_Session::paramString('bd_prefix'),
'pdo_options' => [],
],
'pubsubhubbub_enabled' => Minz_Request::serverIsPublic($base_url),
];
- if (Minz_Session::param('title') != '') {
- $config_array['title'] = Minz_Session::param('title');
+ if (Minz_Session::paramString('title') != '') {
+ $config_array['title'] = Minz_Session::paramString('title');
}
$customConfigPath = DATA_PATH . '/config.custom.php';
@@ -177,7 +179,7 @@ function saveStep2(): void {
if ($ok) {
Minz_Session::_param('bd_error');
header('Location: index.php?step=3');
- } elseif (Minz_Session::param('bd_error') == '') {
+ } elseif (Minz_Session::paramString('bd_error') == '') {
Minz_Session::_param('bd_error', 'Unknown error!');
}
}
@@ -186,7 +188,7 @@ function saveStep2(): void {
function saveStep3(): bool {
FreshRSS_Context::initSystem();
- Minz_Translate::init(Minz_Session::param('language'));
+ Minz_Translate::init(Minz_Session::paramString('language'));
if (!empty($_POST)) {
if (param('auth_type', 'form') != '') {
@@ -220,16 +222,16 @@ function saveStep3(): bool {
// Create default user files but first, we delete previous data to
// avoid access right problems.
- recursive_unlink(USERS_PATH . '/' . Minz_Session::param('default_user'));
+ recursive_unlink(USERS_PATH . '/' . Minz_Session::paramString('default_user'));
$ok = false;
try {
$ok = FreshRSS_user_Controller::createUser(
- Minz_Session::param('default_user'),
+ Minz_Session::paramString('default_user'),
'', //TODO: Add e-mail
$password_plain,
[
- 'language' => Minz_Session::param('language'),
+ 'language' => Minz_Session::paramString('language'),
'is_admin' => true,
'enabled' => true,
]
@@ -270,8 +272,8 @@ function checkStep(): void {
/** @return array<string,string> */
function checkStep0(): array {
$languages = Minz_Translate::availableLanguages();
- $language = Minz_Session::param('language') != '' && in_array(Minz_Session::param('language'), $languages, true);
- $sessionWorking = Minz_Session::param('sessionWorking') === 'ok';
+ $language = Minz_Session::paramString('language') != '' && in_array(Minz_Session::paramString('language'), $languages, true);
+ $sessionWorking = Minz_Session::paramString('sessionWorking') === 'ok';
return [
'language' => $language ? 'ok' : 'ko',
@@ -310,8 +312,8 @@ function freshrss_already_installed(): bool {
function checkStep2(): array {
$conf = is_writable(join_path(DATA_PATH, 'config.php'));
- $bd = Minz_Session::param('bd_type') != '';
- $conn = Minz_Session::param('bd_error') == '';
+ $bd = Minz_Session::paramString('bd_type') != '';
+ $conn = Minz_Session::paramString('bd_error') == '';
return [
'bd' => $bd ? 'ok' : 'ko',
@@ -323,13 +325,13 @@ function checkStep2(): array {
/** @return array<string,string> */
function checkStep3(): array {
- $conf = Minz_Session::param('default_user') != '';
+ $conf = Minz_Session::paramString('default_user') != '';
- $form = Minz_Session::param('auth_type') != '';
+ $form = Minz_Session::paramString('auth_type') != '';
$defaultUser = empty($_POST['default_user']) ? null : $_POST['default_user'];
if ($defaultUser === null) {
- $defaultUser = Minz_Session::param('default_user') == '' ? '' : Minz_Session::param('default_user');
+ $defaultUser = Minz_Session::paramString('default_user') == '' ? '' : Minz_Session::paramString('default_user');
}
$data = is_writable(join_path(USERS_PATH, $defaultUser, 'config.php'));
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml
index ba2d28fd3..1b2f0076e 100644
--- a/app/layout/aside_configure.phtml
+++ b/app/layout/aside_configure.phtml
@@ -1,16 +1,17 @@
<?php
-function get_logout_url(): string {
- if (($_SERVER['AUTH_TYPE'] ?? '') === 'openid-connect') {
- $url_string = urlencode(Minz_Request::guessBaseUrl());
- return './oidc/?logout=' . $url_string . '/';
- # The trailing slash is necessary so that we don’t redirect to http://.
- # https://bz.apache.org/bugzilla/show_bug.cgi?id=61355#c13
- } else {
- return _url('auth', 'logout') ?: '';
+ declare(strict_types=1);
+
+ function get_logout_url(): string {
+ if (($_SERVER['AUTH_TYPE'] ?? '') === 'openid-connect') {
+ $url_string = urlencode(Minz_Request::guessBaseUrl());
+ return './oidc/?logout=' . $url_string . '/';
+ # The trailing slash is necessary so that we don’t redirect to http://.
+ # https://bz.apache.org/bugzilla/show_bug.cgi?id=61355#c13
+ } else {
+ return _url('auth', 'logout') ?: '';
+ }
}
-}
?>
-
<nav class="nav nav-list aside" id="aside_feed">
<a class="toggle_aside" href="#close"><?= _i('close') ?></a>
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index 1d23a66d3..1d491ad79 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$actual_view = Minz_Request::actionName();
$class = '';
diff --git a/app/layout/aside_subscription.phtml b/app/layout/aside_subscription.phtml
index e6329df46..9c41603ee 100644
--- a/app/layout/aside_subscription.phtml
+++ b/app/layout/aside_subscription.phtml
@@ -1,3 +1,6 @@
+<?php
+ declare(strict_types=1);
+?>
<nav class="nav nav-list aside" id="aside_feed">
<a class="toggle_aside" href="#close"><?= _i('close') ?></a>
<ul>
diff --git a/app/layout/header.phtml b/app/layout/header.phtml
index c49d98508..e5722abb6 100644
--- a/app/layout/header.phtml
+++ b/app/layout/header.phtml
@@ -1,3 +1,6 @@
+<?php
+ declare(strict_types=1);
+?>
<header class="header">
<div class="item title">
<a href="<?= _url('index', 'index') ?>">
@@ -16,7 +19,7 @@
<form action="<?= _url('index', 'index') ?>" method="get">
<div class="stick">
<input type="search" name="search" id="search"
- value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES), ENT_COMPAT, 'UTF-8') ?>"
+ value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search->getRawInput(), ENT_QUOTES), ENT_COMPAT, 'UTF-8') ?>"
placeholder="<?= _t('gen.menu.search') ?>" />
<?php $param_a = Minz_Request::actionName(); ?>
diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml
index 56c7e688e..49cf85a02 100644
--- a/app/layout/layout.phtml
+++ b/app/layout/layout.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
FreshRSS::preLayout();
?>
diff --git a/app/layout/nav_entries.phtml b/app/layout/nav_entries.phtml
index 55e1743dc..e640f265d 100644
--- a/app/layout/nav_entries.phtml
+++ b/app/layout/nav_entries.phtml
@@ -1,3 +1,6 @@
+<?php
+ declare(strict_types=1);
+?>
<nav>
<ul id="nav_entries">
<li class="item"><a class="previous_entry" href="#"><?= _i('prev') ?></a></li>
diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml
index 418b6c54c..72838094f 100644
--- a/app/layout/nav_menu.phtml
+++ b/app/layout/nav_menu.phtml
@@ -1,7 +1,7 @@
<?php
+ declare(strict_types=1);
$actual_view = Minz_Request::actionName();
?>
-
<nav class="nav_menu">
<?php if ($actual_view === 'normal' || $actual_view === 'reader') { ?>
<div class="group">
@@ -35,7 +35,7 @@
<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
<div id="dropdown-search" class="dropdown-target"></div>
- <a id="toggle-search" class="dropdown-toggle btn<?= (strlen(FreshRSS_Context::$search) > 0) ? ' active' : ''; ?>" title="<?= _t('gen.menu.search') ?>"
+ <a id="toggle-search" class="dropdown-toggle btn<?= (strlen(FreshRSS_Context::$search->getRawInput()) > 0) ? ' active' : ''; ?>" title="<?= _t('gen.menu.search') ?>"
href="#dropdown-search"><?= _i('search') ?></a>
<ul class="dropdown-menu">
<li class="item">
@@ -63,7 +63,7 @@
<div class="stick search">
<input type="search" name="search"
- value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES), ENT_COMPAT, 'UTF-8'); ?>"
+ value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search->getRawInput(), ENT_QUOTES), ENT_COMPAT, 'UTF-8'); ?>"
placeholder="<?= _t('gen.menu.search') ?>" title="<?= _t('gen.menu.search') ?>" /><button class="btn" type="submit" title="<?= _t('index.menu.search_short') ?>"><?= _i('search') ?></button>
</div>
<p class="help"><?= _i('help') ?> <?= _t('gen.menu.search_help') ?></a></p>
@@ -128,7 +128,7 @@
'get' => $get,
'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,
),
);
diff --git a/app/layout/simple.phtml b/app/layout/simple.phtml
index 7251f6810..b9f74cf59 100644
--- a/app/layout/simple.phtml
+++ b/app/layout/simple.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
FreshRSS::preLayout();
?>
diff --git a/app/shares.php b/app/shares.php
index b3733e1f3..518898625 100644
--- a/app/shares.php
+++ b/app/shares.php
@@ -1,5 +1,4 @@
<?php
-
declare(strict_types=1);
/*
diff --git a/app/views/auth/formLogin.phtml b/app/views/auth/formLogin.phtml
index 29f98d20b..6deade3f4 100644
--- a/app/views/auth/formLogin.phtml
+++ b/app/views/auth/formLogin.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<main class="prompt">
<h1><?= _t('gen.auth.login') ?></h1>
diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml
index 45183592a..78762c19e 100644
--- a/app/views/auth/index.phtml
+++ b/app/views/auth/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/auth/register.phtml b/app/views/auth/register.phtml
index 98276452f..953b07b0d 100644
--- a/app/views/auth/register.phtml
+++ b/app/views/auth/register.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<main class="prompt">
<h1><?= _t('gen.auth.registration') ?></h1>
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml
index 47281e2f1..6004cec1b 100644
--- a/app/views/configure/archiving.phtml
+++ b/app/views/configure/archiving.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index 131583408..b48dcbf71 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml
index 34c10b3c3..fc3cc2a32 100644
--- a/app/views/configure/integration.phtml
+++ b/app/views/configure/integration.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
@@ -66,7 +66,7 @@
<input type="hidden" id="share_<?= $key ?>_type" name="share[<?= $key ?>][type]" value="<?= $share->type() ?>" />
<input type="hidden" id="share_<?= $key ?>_method" name="share[<?= $key ?>][method]" value="<?= $share->method() ?>" />
<input type="hidden" id="share_<?= $key ?>_field" name="share[<?= $key ?>][field]" value="<?= $share->field() ?>" />
-
+
<?php if ($share->isDeprecated()) { ?>
<div class="prompt alert alert-warn">
<p><?= _t('conf.sharing.deprecated') ?></p>
@@ -82,13 +82,13 @@
data-leave-validation="<?= $share->name() ?>" />
</div>
</div>
-
+
<div class="form-group">
<?php if ($share->formType() === 'advanced') { ?>
<label class="group-name" for="share_<?= $key ?>_url">
<?= _t('conf.sharing.share_url') ?>
</label>
-
+
<div class="group-controls">
<div class="stick">
<input type="url" id="share_<?= $key ?>_url" name="share[<?= $key ?>][url]" class="long" value="<?= $share->baseUrl() ?>"
@@ -99,7 +99,7 @@
</div>
<?php } ?>
</div>
-
+
<div class="form-group">
<div class="group-controls">
<button type="button" class="remove btn btn-attention" title="<?= _t('conf.sharing.remove') ?>"><?= _t('gen.action.remove') ?></button>
diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml
index 24c06ac5a..2a55eb1b2 100644
--- a/app/views/configure/queries.phtml
+++ b/app/views/configure/queries.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
@@ -19,7 +19,7 @@
<a class="configure open-slider" href="<?= _url('configure', 'query', 'id', '' . $key) ?>"><?= _i('configure') ?></a><h2><?= $query->getName() ?></h2>
<input type="hidden" id="queries_<?= $key ?>_name" name="queries[<?= $key ?>][name]" value="<?= $query->getName() ?>"/>
<input type="hidden" id="queries_<?= $key ?>_url" name="queries[<?= $key ?>][url]" value="<?= $query->getUrl() ?>"/>
- <input type="hidden" id="queries_<?= $key ?>_search" name="queries[<?= $key ?>][search]" value="<?= urlencode($query->getSearch()) ?>"/>
+ <input type="hidden" id="queries_<?= $key ?>_search" name="queries[<?= $key ?>][search]" value="<?= urlencode($query->getSearch()->getRawInput()) ?>"/>
<input type="hidden" id="queries_<?= $key ?>_state" name="queries[<?= $key ?>][state]" value="<?= $query->getState() ?>"/>
<input type="hidden" id="queries_<?= $key ?>_order" name="queries[<?= $key ?>][order]" value="<?= $query->getOrder() ?>"/>
<input type="hidden" id="queries_<?= $key ?>_get" name="queries[<?= $key ?>][get]" value="<?= $query->getGet() ?>"/>
diff --git a/app/views/configure/query.phtml b/app/views/configure/query.phtml
index 9284ae94e..e45820fbc 100644
--- a/app/views/configure/query.phtml
+++ b/app/views/configure/query.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml
index 669fa7a16..5f22d4daf 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml
index ca4a42c86..e578938cd 100644
--- a/app/views/configure/shortcut.phtml
+++ b/app/views/configure/shortcut.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml
index b1522749f..d19698932 100644
--- a/app/views/configure/system.phtml
+++ b/app/views/configure/system.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/entry/bookmark.phtml b/app/views/entry/bookmark.phtml
index 9c3fe2076..192e805a0 100644
--- a/app/views/entry/bookmark.phtml
+++ b/app/views/entry/bookmark.phtml
@@ -1,5 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
<?php
+declare(strict_types=1);
+/** @var FreshRSS_View $this */
+
header('Content-Type: application/json; charset=UTF-8');
$url = array(
diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml
index 2d1760b87..071782895 100644
--- a/app/views/entry/read.phtml
+++ b/app/views/entry/read.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
header('Content-Type: application/json; charset=UTF-8');
diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml
index abebc8332..50ad16eba 100644
--- a/app/views/error/index.phtml
+++ b/app/views/error/index.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<main class="post">
<div class="alert alert-error">
<h1 class="alert-head"><?= $this->code ?></h1>
diff --git a/app/views/extension/configure.phtml b/app/views/extension/configure.phtml
index 27946e202..c722b3a1e 100644
--- a/app/views/extension/configure.phtml
+++ b/app/views/extension/configure.phtml
@@ -1,3 +1,4 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->renderHelper('extension/configure');
diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml
index 9b8c122e6..7bec7b233 100644
--- a/app/views/extension/index.phtml
+++ b/app/views/extension/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml
index 3461e6e61..c51289f56 100644
--- a/app/views/feed/add.phtml
+++ b/app/views/feed/add.phtml
@@ -1,5 +1,8 @@
-<?php /** @var FreshRSS_View $this */ ?>
-<?php if ($this->feed) { ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+ if ($this->feed) {
+?>
<main class="post">
<h1><?= _t('sub.feed.add') ?></h1>
diff --git a/app/views/feed/contentSelectorPreview.phtml b/app/views/feed/contentSelectorPreview.phtml
index 7ff251e38..a5afb10f4 100644
--- a/app/views/feed/contentSelectorPreview.phtml
+++ b/app/views/feed/contentSelectorPreview.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
FreshRSS::preLayout();
?>
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 { ?>
diff --git a/app/views/importExport/export.phtml b/app/views/importExport/export.phtml
index 21ed71b2d..af0b21ea1 100644
--- a/app/views/importExport/export.phtml
+++ b/app/views/importExport/export.phtml
@@ -1,2 +1,4 @@
-<?php /** @var FreshRSS_View $this */ ?>
-<?= $this->content ?>
+<?php
+declare(strict_types=1);
+/** @var FreshRSS_View $this */
+echo $this->content;
diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml
index adc236dc4..3e8fde09f 100644
--- a/app/views/importExport/index.phtml
+++ b/app/views/importExport/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_subscription');
?>
-
<main class="post ">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/index/about.phtml b/app/views/index/about.phtml
index 1966c1f6b..5ee1729cd 100644
--- a/app/views/index/about.phtml
+++ b/app/views/index/about.phtml
@@ -1,10 +1,10 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
if (FreshRSS_Auth::hasAccess()) {
$this->partial('aside_configure');
}
?>
-
<main class="post content<?= !FreshRSS_Auth::hasAccess() ? ' centered' : ''?>">
<?php if (FreshRSS_Auth::hasAccess()) {?>
<div class="link-back-wrapper">
diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml
index 6e3b2378b..0ddc22e11 100644
--- a/app/views/index/global.phtml
+++ b/app/views/index/global.phtml
@@ -1,4 +1,5 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('nav_menu');
@@ -12,7 +13,6 @@
$state_unread = true;
}
?>
-
<main id="stream" class="global<?= $class ?>">
<h1 class="title_hidden"><?= _t('conf.reading.view.global') ?></h1>
<?php
diff --git a/app/views/index/logs.phtml b/app/views/index/logs.phtml
index cba6f5243..7913405ca 100644
--- a/app/views/index/logs.phtml
+++ b/app/views/index/logs.phtml
@@ -1,5 +1,8 @@
-<?php /** @var FreshRSS_View $this */ ?>
-<?php $this->partial('aside_configure'); ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+ $this->partial('aside_configure');
+?>
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index aee2ea2a2..feda1466f 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
$this->partial('aside_feed');
diff --git a/app/views/index/opml.phtml b/app/views/index/opml.phtml
index 69dace924..f55461165 100644
--- a/app/views/index/opml.phtml
+++ b/app/views/index/opml.phtml
@@ -1,3 +1,4 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->renderHelper('export/opml');
diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml
index 014b1ab42..dc90a144a 100644
--- a/app/views/index/reader.phtml
+++ b/app/views/index/reader.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
$this->partial('aside_feed');
diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml
index f9c9d9297..a6d0d2a10 100644
--- a/app/views/index/rss.phtml
+++ b/app/views/index/rss.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<?= '<?xml version="1.0" encoding="UTF-8" ?>'; ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/"
<?= $this->rss_base == '' ? '' : ' xml:base="' . $this->rss_base . '"' ?>
diff --git a/app/views/index/tos.phtml b/app/views/index/tos.phtml
index 8a9c2f583..6a2aa7ce8 100644
--- a/app/views/index/tos.phtml
+++ b/app/views/index/tos.phtml
@@ -1,10 +1,10 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
if (FreshRSS_Auth::hasAccess()) {
$this->partial('aside_configure');
}
?>
-
<main class="post content<?= !FreshRSS_Auth::hasAccess() ? ' centered' : ''?>">
<?php if (FreshRSS_Auth::hasAccess()) {?>
<div class="link-back-wrapper">
diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml
index 1a8af6e49..bce316d85 100644
--- a/app/views/javascript/actualize.phtml
+++ b/app/views/javascript/actualize.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_ViewJavascript $this */
$categories = [];
diff --git a/app/views/javascript/nbUnreadsPerFeed.phtml b/app/views/javascript/nbUnreadsPerFeed.phtml
index 4864b429a..f82893f13 100644
--- a/app/views/javascript/nbUnreadsPerFeed.phtml
+++ b/app/views/javascript/nbUnreadsPerFeed.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_ViewJavascript $this */
$result = array(
diff --git a/app/views/javascript/nonce.phtml b/app/views/javascript/nonce.phtml
index df1389f15..e7dceb339 100644
--- a/app/views/javascript/nonce.phtml
+++ b/app/views/javascript/nonce.phtml
@@ -1,3 +1,4 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_ViewJavascript $this */
echo json_encode(array('salt1' => $this->salt1, 'nonce' => $this->nonce));
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml
index 37cc92144..a671bb83e 100644
--- a/app/views/stats/idle.phtml
+++ b/app/views/stats/idle.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_ViewStats $this */
$this->partial('aside_subscription');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml
index 593474ac7..4e14d0fc7 100644
--- a/app/views/stats/index.phtml
+++ b/app/views/stats/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_ViewStats $this */
$this->partial('aside_subscription');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml
index 6923f6992..030db0906 100644
--- a/app/views/stats/repartition.phtml
+++ b/app/views/stats/repartition.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_ViewStats $this */
$this->partial('aside_subscription');
?>
-
<main class="post ">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/subscription/add.phtml b/app/views/subscription/add.phtml
index 1f07e2931..2dfc8c705 100644
--- a/app/views/subscription/add.phtml
+++ b/app/views/subscription/add.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_subscription');
?>
-
<main class="post drop-section">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/subscription/bookmarklet.phtml b/app/views/subscription/bookmarklet.phtml
index 540bf8e52..d96f8a35b 100644
--- a/app/views/subscription/bookmarklet.phtml
+++ b/app/views/subscription/bookmarklet.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_subscription');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/subscription/category.phtml b/app/views/subscription/category.phtml
index 0b63ebc17..daf4523bb 100644
--- a/app/views/subscription/category.phtml
+++ b/app/views/subscription/category.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
diff --git a/app/views/subscription/feed.phtml b/app/views/subscription/feed.phtml
index e361cff39..934e3c690 100644
--- a/app/views/subscription/feed.phtml
+++ b/app/views/subscription/feed.phtml
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml
index 6881d0a8d..280799f2d 100644
--- a/app/views/subscription/index.phtml
+++ b/app/views/subscription/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_subscription');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/tag/getTagsForEntry.phtml b/app/views/tag/getTagsForEntry.phtml
index 46a82ca68..b2a0d78a7 100644
--- a/app/views/tag/getTagsForEntry.phtml
+++ b/app/views/tag/getTagsForEntry.phtml
@@ -1,3 +1,4 @@
-<?php /** @var FreshRSS_View $this */ ?>
<?php
+declare(strict_types=1);
+/** @var FreshRSS_View $this */
echo json_encode($this->tagsForEntry);
diff --git a/app/views/tag/index.phtml b/app/views/tag/index.phtml
index c80e0c209..eed8906c4 100644
--- a/app/views/tag/index.phtml
+++ b/app/views/tag/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_subscription');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml
index 077eb2184..291e634f8 100644
--- a/app/views/update/apply.phtml
+++ b/app/views/update/apply.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml
index 393a9fdee..19e3d2e1e 100644
--- a/app/views/update/checkInstall.phtml
+++ b/app/views/update/checkInstall.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml
index 2e24b3086..c93d1a75e 100644
--- a/app/views/update/index.phtml
+++ b/app/views/update/index.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/user/details.phtml b/app/views/user/details.phtml
index a2a560a65..1ea8f62d8 100644
--- a/app/views/user/details.phtml
+++ b/app/views/user/details.phtml
@@ -1,14 +1,13 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
if (!Minz_Request::paramBoolean('ajax')) {
$this->partial('aside_configure');
}
+ $isDefault = $this->details['is_default'];
+ $isAdmin = $this->details['is_admin'];
+ $enabled = $this->details['enabled'];
?>
-
-<?php $isDefault = $this->details['is_default']; ?>
-<?php $isAdmin = $this->details['is_admin']; ?>
-<?php $enabled = $this->details['enabled']; ?>
-
<div class="post">
<h2><?= $this->username ?><?php if ($isAdmin) echo ' ― ', _t('admin.user.admin'); ?></h2>
<form method="post" action="<?= _url('user', 'manage', 'username', $this->username); ?>">
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml
index 827ba39da..dcff153d6 100644
--- a/app/views/user/manage.phtml
+++ b/app/views/user/manage.phtml
@@ -1,8 +1,8 @@
<?php
+ declare(strict_types=1);
/** @var FreshRSS_View $this */
$this->partial('aside_configure');
?>
-
<main class="post">
<div class="link-back-wrapper">
<a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml
index b5fbb04b5..0a41d4dc4 100644
--- a/app/views/user/profile.phtml
+++ b/app/views/user/profile.phtml
@@ -1,5 +1,6 @@
-<?php /** @var FreshRSS_View $this */ ?>
<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
if (!$this->disable_aside) {
$this->partial('aside_configure');
}
diff --git a/app/views/user/validateEmail.phtml b/app/views/user/validateEmail.phtml
index bd36510dd..8f822fe6a 100644
--- a/app/views/user/validateEmail.phtml
+++ b/app/views/user/validateEmail.phtml
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<main class="post">
<p>
<?= _t('user.email.validation.need_to', FreshRSS_Context::$system_conf->title) ?>
diff --git a/app/views/user_mailer/email_need_validation.txt.php b/app/views/user_mailer/email_need_validation.txt.php
index 2785911bf..5799499e7 100644
--- a/app/views/user_mailer/email_need_validation.txt.php
+++ b/app/views/user_mailer/email_need_validation.txt.php
@@ -1,4 +1,7 @@
-<?php /** @var FreshRSS_View $this */ ?>
+<?php
+ declare(strict_types=1);
+ /** @var FreshRSS_View $this */
+?>
<?= _t('user.mailer.email_need_validation.welcome', $this->username) ?>
<?= _t('user.mailer.email_need_validation.body', $this->site_title) ?>