From fb8afd99b1c90b5c673d1f2cf7b6ee1bd7886c50 Mon Sep 17 00:00:00 2001 From: Matthieu Marcillaud <marcimat@rezo.net> Date: Fri, 14 Jan 2022 10:47:42 +0100 Subject: [PATCH] Simplifier urls_page_dist() (PHP 7.4+) --- ecrire/urls/page.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ecrire/urls/page.php b/ecrire/urls/page.php index f939f807e7..5e9ef59e69 100644 --- a/ecrire/urls/page.php +++ b/ecrire/urls/page.php @@ -82,14 +82,8 @@ function urls_page_dist($i, &$entite, $args = '', $ancre = '') { // Si on est revenu en mode html, mais c'est une ancienne url_propre // on ne redirige pas, on assume le nouveau contexte (si possible) $url = $i; - $url_propre = isset($url) - ? $url - : (isset($_SERVER['REDIRECT_url_propre']) - ? $_SERVER['REDIRECT_url_propre'] - : (isset($_ENV['url_propre']) - ? $_ENV['url_propre'] - : '' - )); + $url_propre = $url ?? $_SERVER['REDIRECT_url_propre'] ?? $_ENV['url_propre'] ?? ''; + if ($url_propre) { if ($GLOBALS['profondeur_url'] <= 0) { $urls_anciennes = charger_fonction('propres', 'urls', true); -- GitLab