From 60ff6243f484fae66f3e3d8146b6a0677e8e5cf8 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Wed, 13 Nov 2024 12:27:12 +0100 Subject: [PATCH] bugfix systemhealth database version > 10.2 --- phpwf/plugins/class.mysql.php | 3 ++- www/pages/systemhealth.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/phpwf/plugins/class.mysql.php b/phpwf/plugins/class.mysql.php index 45aa4686..d2047e03 100644 --- a/phpwf/plugins/class.mysql.php +++ b/phpwf/plugins/class.mysql.php @@ -154,7 +154,8 @@ class DB{ $version_stringFormat = str_replace('.','',$version_string); return ['mysql', $version_string, $version_stringFormat]; } - $mariaVersion = substr($version, 0, 4); + $version_array = explode('.', $version); + $mariaVersion = $version_array[0].'.'.$version_array[1]; $version_stringFormat = str_replace('.','', $mariaVersion); return ['mariadb',$mariaVersion, $version_stringFormat]; } diff --git a/www/pages/systemhealth.php b/www/pages/systemhealth.php index a685b840..0cacbbc7 100644 --- a/www/pages/systemhealth.php +++ b/www/pages/systemhealth.php @@ -486,8 +486,8 @@ class Systemhealth { $dbVersionArr = explode('.',$dbVersion); - if($dbVersionArr[0] >= 10 && !($dbVersionArr[1] < 2)) { - $status = 'ok'; + if (($dbVersionArr[0] == 10 && !($dbVersionArr[1] < 2)) || ($dbVersionArr[0] > 10)) { + $status = 'ok'; } $mysqlVersion = 'MariaDB '.$dbVersion; }