From 7eea49897f839b7ada4c249c6473803810bba031 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Wed, 16 Aug 2023 14:05:00 +0300 Subject: [PATCH] Making PHPStan happy --- .gitignore | 1 + version.inc.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e92f57 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tags diff --git a/version.inc.php b/version.inc.php index 6e89f2a..c412c5f 100644 --- a/version.inc.php +++ b/version.inc.php @@ -40,7 +40,7 @@ function game_version_code($str = null) $min = $items[1]; $pat = isset($items[2]) ? $items[2] : 0; - $num = $pat + $min*100 + $maj*1000000; + $num = $pat + intval($min)*100 + intval($maj)*1000000; return $num; } @@ -67,6 +67,8 @@ function get_inc_game_version() { $string = game_version(); + $most_significant_number = -1; + for($i = strlen($string) - 1; $i >= 0; $i--) { if(is_numeric($string[$i])) @@ -98,4 +100,4 @@ function get_version_file_lifetime() $minutes = (time() - strtotime($out[0])) / 60; return ceil($minutes); -} \ No newline at end of file +}