Skip to content

Commit

Permalink
clean checkNewVersionAvailable and adopt standard versionning; see #163
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh committed Oct 13, 2015
1 parent 9854a98 commit 29c9d40
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions inc/toolbox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1375,45 +1375,7 @@ static function checkNewVersionAvailable($auto=true, $messageafterredirect=false
}

} else {
$splitted = explode(".", trim($CFG_GLPI["version"]));

if ($splitted[0] < 10) {
$splitted[0] .= "0";
}

if ($splitted[1] < 10) {
$splitted[1] .= "0";
}

$cur_version = ($splitted[0]*10000) + ($splitted[1]*100);

if (isset($splitted[2])) {
if ($splitted[2] < 10) {
$splitted[2] .= "0";
}
$cur_version += $splitted[2];
}

$splitted = explode(".", trim($latest_version));

if ($splitted[0] < 10) {
$splitted[0] .= "0";
}

if ($splitted[1] < 10) {
$splitted[1] .= "0";
}

$lat_version = ($splitted[0]*10000) + ($splitted[1]*100);

if (isset($splitted[2])) {
if ($splitted[2] < 10) {
$splitted[2] .= "0";
}
$lat_version += $splitted[2];
}

if ($cur_version < $lat_version) {
if (version_compare($CFG_GLPI["version"], $latest_version, '<')) {
$config_object = new Config();
$input["id"] = 1;
$input["founded_new_version"] = $latest_version;
Expand Down

0 comments on commit 29c9d40

Please sign in to comment.