N°4714 Fix \utils::GetCoreVersionWikiSyntax throwing Exception when 2nd version digit is "0" (for example in 3.0.1)

This commit is contained in:
Pierre Goiffon
2022-02-08 14:48:02 +01:00
parent 84280a3b5f
commit 299ad7e753
2 changed files with 31 additions and 3 deletions

View File

@@ -2250,11 +2250,11 @@ class utils
* @throws \ApplicationException if constant value is invalid
* @uses ITOP_CORE_VERSION
*/
public static function GetCoreVersionWikiSyntax()
public static function GetCoreVersionWikiSyntax($sItopVersion = ITOP_CORE_VERSION)
{
$aExplodedVersion = explode('.', ITOP_CORE_VERSION);
$aExplodedVersion = explode('.', $sItopVersion);
if (empty($aExplodedVersion[0]) || empty($aExplodedVersion[1])) {
if ((false === isset($aExplodedVersion[0])) || (false === isset($aExplodedVersion[1]))) {
throw new ApplicationException('iTop version is wrongfully configured!');
}