From 73229b472638507cdc4c1d76631b959871371a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Fri, 20 Dec 2024 21:38:24 +0100 Subject: [PATCH] =?UTF-8?q?Bug=20t=C3=A9l=C3=A9chargement=20descripteur=20?= =?UTF-8?q?de=20langues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/language/language.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/module/language/language.php b/core/module/language/language.php index c380998..8fe4d3d 100644 --- a/core/module/language/language.php +++ b/core/module/language/language.php @@ -91,16 +91,15 @@ class language extends common } // Télécharger le descripteur en ligne - $languageData = json_decode(helper::getUrlContents(self::ZWII_UI_URL . $lang . '.json'), true); + $languageData = helper::getUrlContents(self::ZWII_UI_URL . $lang . '.json'); $descripteur = json_decode(helper::getUrlContents(self::ZWII_UI_URL . 'language.json'), true); $success = false; if ( - is_array($languageData) && + $languageData && is_array($descripteur['language'][$lang]) ) { if ($this->setData(['language', $lang, $descripteur['language'][$lang]])) { - $success = $this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($languageData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); - $success = is_int($success) ? true : false; + $success = $this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $languageData); } }