diff --git a/setup/inc/class.setup.inc.php b/setup/inc/class.setup.inc.php index 6b9b4077a6..7c7ed33fa2 100644 --- a/setup/inc/class.setup.inc.php +++ b/setup/inc/class.setup.inc.php @@ -451,17 +451,18 @@ class setup * Return X.X.X major version from X.X.X.X versionstring * * @param string $versionstring + * @return string major version or '' for !$versionstring, e.g. for null */ function get_major($versionstring) { if(!$versionstring) { - return False; + return ''; } - $version = str_replace('pre','.',$versionstring); - $varray = explode('.',$version); - $major = implode('.',array($varray[0],$varray[1],$varray[2])); + $version = str_replace('pre','.', $versionstring); + $varray = explode('.', $version); + $major = implode('.', array_slice($varray, 0, 3)); return $major; } diff --git a/setup/inc/class.setup_detection.inc.php b/setup/inc/class.setup_detection.inc.php index f57a3c7fbc..62d40cd126 100755 --- a/setup/inc/class.setup_detection.inc.php +++ b/setup/inc/class.setup_detection.inc.php @@ -185,7 +185,7 @@ class setup_detection foreach($depvalue['versions'] as $depsvalue) { - $currentver = $setup_info[$depvalue['appname']]['currentver']; + $currentver = $setup_info[$depvalue['appname']]['currentver'] ?? ''; if ($depvalue['appname'] == 'phpgwapi' && substr($currentver,0,6) == '0.9.99') { $currentver = '0.9.14.508';