aboutsummaryrefslogtreecommitdiff
path: root/src/router.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-11-02 20:51:05 +0100
committerpolo <ordipolo@gmx.fr>2025-11-02 20:51:05 +0100
commit4c9786a3faf12f423b2431883bc23c07c84fc7c0 (patch)
tree1d286cb5a15f3cee08a6339269615dfd4f95b4e1 /src/router.php
parent28d300b48ded1d472d3593f3afc0c71c4fd2e0aa (diff)
downloadcms-4c9786a3faf12f423b2431883bc23c07c84fc7c0.tar.gz
cms-4c9786a3faf12f423b2431883bc23c07c84fc7c0.tar.bz2
cms-4c9786a3faf12f423b2431883bc23c07c84fc7c0.zip
menu caché seulement si il ne comporte vraiment qu'une entrée
Diffstat (limited to 'src/router.php')
-rw-r--r--src/router.php4
1 files changed, 2 insertions, 2 deletions
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{
333if(isset($response)){ 333if(isset($response)){
334 // 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 334 // 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
335 if($request->isMethod('GET') && $response->getStatusCode() == 302){ // 302 redirection temporaire 335 if($request->isMethod('GET') && $response->getStatusCode() == 302){ // 302 redirection temporaire
336 header('Location: ' . new URL(['page' => !empty($_GET['from']) ? $_GET['from'] : 'accueil'])); 336 header('Location: ' . new URL(['page' => $_GET['from'] ?? '']));
337 } 337 }
338 // redirection après traitement de formulaires HTTP 338 // redirection après traitement de formulaires HTTP
339 elseif($request->getMethod() === 'POST' && $_SERVER['CONTENT_TYPE'] === 'application/x-www-form-urlencoded'){ 339 elseif($request->getMethod() === 'POST' && $_SERVER['CONTENT_TYPE'] === 'application/x-www-form-urlencoded'){
340 $response_data = json_decode(($response)->getContent(), true); 340 $response_data = json_decode(($response)->getContent(), true);
341 $url = new URL(['page' => !empty($_GET['from']) ? $_GET['from'] : 'accueil']); 341 $url = new URL(['page' => $_GET['from'] ?? '']);
342 $url->addParams(['success' => $response_data['success'], 'message' => $response_data['message']]); 342 $url->addParams(['success' => $response_data['success'], 'message' => $response_data['message']]);
343 header('Location: ' . $url); 343 header('Location: ' . $url);
344 } 344 }