From bdd57a6fe941f68e67117df6e6f287a87e6705b2 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 15 Jul 2013 17:42:18 -0400 Subject: [PATCH] Do numeric comparison on db versions Support MariaDB version 10.0 and forward, which previously did not appear to be 'greater than' version 4.4 as in php '10.0' < '4.4'. Performing a split by the dots allows php to perform a numeric comparison. --- setup/inc/class.installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/inc/class.installer.php b/setup/inc/class.installer.php index 5562f33ab..90b915c1d 100644 --- a/setup/inc/class.installer.php +++ b/setup/inc/class.installer.php @@ -83,7 +83,7 @@ class Installer extends SetupWizard { if(!$this->errors) { if(!db_connect($vars['dbhost'],$vars['dbuser'],$vars['dbpass'])) $this->errors['db']='Unable to connect to MySQL server. '.db_connect_error(); - elseif(db_version()< $this->getMySQLVersion()) + elseif(explode('.', db_version()) < explode('.', $this->getMySQLVersion())) $this->errors['db']=sprintf('osTicket requires MySQL %s or better!',$this->getMySQLVersion()); elseif(!db_select_database($vars['dbname']) && !db_create_database($vars['dbname'])) { $this->errors['dbname']='Database doesn\'t exist'; -- GitLab