From ec667eed09c43768fe59289eeec4017d65fd8258 Mon Sep 17 00:00:00 2001 From: bricebou Date: Sun, 1 May 2022 08:13:08 +0200 Subject: [PATCH] =?UTF-8?q?V=C3=A9rifier=20que=20SPIP=20est=20bien=20insta?= =?UTF-8?q?ll=C3=A9=20avant=20de=20chercher=20=C3=A0=20identifier=20la=20v?= =?UTF-8?q?ersion=20install=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Command/CoreListerVersions.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Command/CoreListerVersions.php b/src/Command/CoreListerVersions.php index 15c89e9..b3c6498 100644 --- a/src/Command/CoreListerVersions.php +++ b/src/Command/CoreListerVersions.php @@ -159,10 +159,13 @@ class CoreListerVersions extends Command { * @return string $version */ public static function trouverVersionInstallee() { - if (lire_fichier('ecrire/inc_version.php', $inc)) { - preg_match('/\$spip_version_branche = \'(\d+.\d+.\d+)\';/', $inc, $matches); + global $spip_loaded; + if ($spip_loaded) { + if (lire_fichier('ecrire/inc_version.php', $inc)) { + preg_match('/\$spip_version_branche = \'(\d+.\d+.\d+)\';/', $inc, $matches); - return $matches[1]; + return $matches[1]; + } } } }