From bd1b9e4f73e024c97128101bc59b1fcb05fa6258 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Wed, 8 Oct 2008 22:05:56 +0000 Subject: [PATCH] BGFIX: #2527 - Fix mysql version detection on hosts with custom mysql version names (HakTom) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63904 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/MySQLDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/MySQLDatabase.php b/core/model/MySQLDatabase.php index b4d170891..9e58c1630 100644 --- a/core/model/MySQLDatabase.php +++ b/core/model/MySQLDatabase.php @@ -69,7 +69,7 @@ class MySQLDatabase extends Database { */ public function getVersion() { if(!$this->mysqlVersion) { - $this->mysqlVersion = (float)$this->query("SELECT VERSION()")->value(); + $this->mysqlVersion = (float)substr(trim(ereg_replace("([A-Za-z-])", "", $this->query("SELECT VERSION()")->value())), 0, 3); } return $this->mysqlVersion; }