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]; + } } } }