From ab37ed0ea99288ca22345fccd9269348c5cf5206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Wed, 27 Apr 2022 16:30:51 +0200 Subject: [PATCH] =?UTF-8?q?V=C3=A9rification=20de=20type=20dans=20import?= =?UTF-8?q?=20de=2011307=20+=20suppression=20baseUrl=20de=20core=20+=20num?= =?UTF-8?q?=C3=A9ro=20de=20version=20de=20defaultdata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/include/update.inc.php | 17 ++++++++++------- core/module/config/config.php | 2 -- core/module/install/install.php | 3 --- core/module/install/ressource/defaultdata.php | 5 ++--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 0c36717b..1766a28e 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -924,7 +924,8 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { $files = $this->getData(['fonts', 'files']); if (is_array($files)) { foreach ($files as $fontId => $fontName) { - if (file_exists(self::DATA_DIR . 'fonts/' . $fontName)) { + if ( gettype($fontName) === 'string' + && file_exists(self::DATA_DIR . 'fonts/' . $fontName)) { $this->setData(['fonts', 'files', $fontId, [ 'name' => ucfirst($fontId), 'font-family'=> '\'' . ucfirst($fontId) . '\', sans-serif', @@ -938,11 +939,13 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { $imported = $this->getData(['fonts', 'imported']); if (is_array($imported)) { foreach ($imported as $fontId => $fontUrl) { - $this->setData(['fonts', 'imported', $fontId, [ - 'name' => ucfirst($fontId), - 'font-family'=> '\'' . ucfirst($fontId) . '\', sans-serif', - 'resource' => 'https:\\fonts.cdnfonts.com\css' . $fontUrl - ]]); + if ( gettype($fontUrl) === 'string' ) { + $this->setData(['fonts', 'imported', $fontId, [ + 'name' => ucfirst($fontId), + 'font-family'=> '\'' . ucfirst($fontId) . '\', sans-serif', + 'resource' => 'https:\\fonts.cdnfonts.com\css' . $fontUrl + ]]); + } } } // Importation des fontes exemples @@ -974,7 +977,7 @@ if ($this->getData(['core', 'dataVersion']) < 11400) { */ // Suppression de la variable URL dans core - //$this->deleteData(['core', 'baseUrl']); + $this->deleteData(['core', 'baseUrl']); // Mise à jour $this->setData(['core', 'dataVersion', 11400]); diff --git a/core/module/config/config.php b/core/module/config/config.php index 92ac7a09..02ed0b45 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -573,8 +573,6 @@ class config extends common { // Change le statut de la réécriture d'URL (pour le helper::baseUrl() de la redirection) helper::$rewriteStatus = false; } - // Met à jour la baseUrl - $this->setData(['core', 'baseUrl', helper::baseUrl(true,false) ]); } // Générer robots.txt et sitemap $this->siteMap(); diff --git a/core/module/install/install.php b/core/module/install/install.php index 3bfba425..54f677c3 100644 --- a/core/module/install/install.php +++ b/core/module/install/install.php @@ -122,9 +122,6 @@ class install extends common { mkdir(self::DATA_DIR . 'fonts'); } - // Stocker le dossier d'installation - $this->setData(['core', 'baseUrl', helper::baseUrl(false,false) ]); - // Installation du thème sélectionné $dataThemes = file_get_contents('core/module/install/ressource/themes/themes.json'); $dataThemes = json_decode($dataThemes, true); diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 29cbd3cb..0bc0ecc2 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -57,12 +57,11 @@ class init extends common { ] ], 'core' => [ - 'dataVersion' => 11300, + 'dataVersion' => 11400, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0, - 'updateAvailable' => false, - 'baseUrl' => '' + 'updateAvailable' => false ], 'locale' => [ 'homePageId' => 'accueil',