diff options
| author | 2023-11-16 22:43:00 +0100 | |
|---|---|---|
| committer | 2023-11-16 22:43:00 +0100 | |
| commit | 30c7a61a9b410f023c56ef19b9389a61647d8768 (patch) | |
| tree | bb58408980ce5b86f1d2b4a9be29d55b2d46dbb1 /app/layout | |
| parent | ee99e7e2cc228500efc1b539954c0ca6cd4c146d (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/layout')
| -rw-r--r-- | app/layout/aside_configure.phtml | 21 | ||||
| -rw-r--r-- | app/layout/aside_feed.phtml | 1 | ||||
| -rw-r--r-- | app/layout/aside_subscription.phtml | 3 | ||||
| -rw-r--r-- | app/layout/header.phtml | 5 | ||||
| -rw-r--r-- | app/layout/layout.phtml | 1 | ||||
| -rw-r--r-- | app/layout/nav_entries.phtml | 3 | ||||
| -rw-r--r-- | app/layout/nav_menu.phtml | 8 | ||||
| -rw-r--r-- | app/layout/simple.phtml | 1 |
8 files changed, 28 insertions, 15 deletions
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(); ?> |
