From cf184e902e5e5a835f424182e3139a5cf80d6bb1 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 15 Dec 2023 22:07:25 +0100 Subject: [PATCH] Evite une 404 si la page est contenue dans un espace --- core/class/router.class.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/core/class/router.class.php b/core/class/router.class.php index c6c42f8..756f0f0 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -546,7 +546,7 @@ class core extends common // Pour éviter une 404 sur une langue étrangère, bascule dans la langue correcte. if (is_null($this->getData(['page', $this->getUrl(0)]))) { - foreach (self::$languages as $key => $value) { + foreach ($this->getData(['course']) as $key => $value) {; if ( is_dir(self::DATA_DIR . $key) && file_exists(self::DATA_DIR . $key . '/page.json') @@ -891,15 +891,6 @@ class core extends common exit(); } if ($access === false) { - // Bascule sur le site d'accueil - /*if ( - isset($_SESSION['ZWII_SITE_CONTENT']) - && $_SESSION['ZWII_SITE_CONTENT'] !== 'home' - ) { - $_SESSION['ZWII_SITE_CONTENT'] = 'home'; - header('Location:' . helper::baseUrl() . $this->getUrl()); - exit(); - }*/ http_response_code(403); if ($accessInfo['userName']) { $this->addOutput([ @@ -920,15 +911,6 @@ class core extends common } } } elseif ($this->output['content'] === '') { - // Bascule sur le site d'accueil pour afficher la page d'erreur - /*if ( - isset($_SESSION['ZWII_SITE_CONTENT']) - && $_SESSION['ZWII_SITE_CONTENT'] !== 'home' - ) { - $_SESSION['ZWII_SITE_CONTENT'] = 'home'; - header('Location:' . helper::baseUrl() . $this->getUrl()); - exit(); - }*/ http_response_code(404); if ( $this->getData(['config', 'page404']) !== 'none'