12307 lien vers une page d'une autre langue

This commit is contained in:
Fred Tempez 2023-04-11 15:07:38 +02:00
parent b0f064dac4
commit a5ab6b772a
1 changed files with 2 additions and 1 deletions

View File

@ -387,7 +387,8 @@ class 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) {
if (is_dir(self::DATA_DIR . $key)) {
if (is_dir(self::DATA_DIR . $key) &&
file_exists(self::DATA_DIR . $key . '/page.json')) {
$pagesId = json_decode(file_get_contents(self::DATA_DIR . $key . '/page.json'), true);
if (array_key_exists($this->getUrl(0), $pagesId['page'])) {
setcookie('ZWII_CONTENT', $key, time() + 3600, helper::baseUrl(false, false), '', true, helper::isHttps());