Skip to content
Snippets Groups Projects
Commit bdd57a6f authored by Jared Hancock's avatar Jared Hancock
Browse files

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.
parent c8536fe6
No related branches found
No related tags found
No related merge requests found
......@@ -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';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment