From 4c9786a3faf12f423b2431883bc23c07c84fc7c0 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 2 Nov 2025 20:51:05 +0100 Subject: =?UTF-8?q?menu=20cach=C3=A9=20seulement=20si=20il=20ne=20comporte?= =?UTF-8?q?=20vraiment=20qu'une=20entr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/router.php') diff --git a/src/router.php b/src/router.php index 42ccaed..15d5a4c 100644 --- a/src/router.php +++ b/src/router.php @@ -333,12 +333,12 @@ else{ if(isset($response)){ // cas gérés (d'autres sont à prévoir): mauvais id de la page article, accès page création d'article sans être admin if($request->isMethod('GET') && $response->getStatusCode() == 302){ // 302 redirection temporaire - header('Location: ' . new URL(['page' => !empty($_GET['from']) ? $_GET['from'] : 'accueil'])); + header('Location: ' . new URL(['page' => $_GET['from'] ?? ''])); } // redirection après traitement de formulaires HTTP elseif($request->getMethod() === 'POST' && $_SERVER['CONTENT_TYPE'] === 'application/x-www-form-urlencoded'){ $response_data = json_decode(($response)->getContent(), true); - $url = new URL(['page' => !empty($_GET['from']) ? $_GET['from'] : 'accueil']); + $url = new URL(['page' => $_GET['from'] ?? '']); $url->addParams(['success' => $response_data['success'], 'message' => $response_data['message']]); header('Location: ' . $url); } -- cgit v1.2.3