From fa3c582a2bd91433399a5b275616052028a5a011 Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 18 Sep 2025 00:27:20 +0200 Subject: =?UTF-8?q?news=20positionn=C3=A9es=20en=20fonction=20de=20leur=20?= =?UTF-8?q?date,=20suppression=20de=20leurs=20boutons=20position,=20am?= =?UTF-8?q?=C3=A9liorations=20routage=20page=20article,=20bouton=20share?= =?UTF-8?q?=20en=20bas=20pour=20les=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/router.php') diff --git a/src/router.php b/src/router.php index ccab426..8c33d6e 100644 --- a/src/router.php +++ b/src/router.php @@ -83,8 +83,7 @@ elseif($_SERVER['REQUEST_METHOD'] === 'POST'){ // requêtes JSON avec fetch() if($_SERVER['CONTENT_TYPE'] === 'application/json') { - $data = file_get_contents('php://input'); - $json = json_decode($data, true); + $json = json_decode($request->getContent(), true); // = json_decode(file_get_contents('php://input'), true); if($request->query->has('action')) { @@ -309,7 +308,7 @@ else{ /* -- utilisation de la réponse -- */ if(isset($response)){ - // cas des mauvais id de la page article (d'autres cas à prévoir) + // 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'])); } -- cgit v1.2.3