Skip to content

Commit

Permalink
fix: use version_compare for api update checks #390
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhendrickson13 committed Sep 7, 2023
1 parent 7b56876 commit 080783a
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ class APISystemAPIVersionRead extends APIModel {
}

public static function is_update_available() {
# Check if the current version is less than the latest version
$curr_ver_num = intval(str_replace(".", "", self::get_api_version()));
$latest_ver_num = intval(str_replace(".", "", self::get_latest_api_version()));
return $curr_ver_num < $latest_ver_num;
return version_compare(self::get_api_version(), self::get_latest_api_version(), operator: "<");
}

public static function get_github_releases() {
Expand Down

0 comments on commit 080783a

Please sign in to comment.