MDL-45070 relax the mariaDB version checker to work with long Ubuntu versions

Example of Ubuntu version: 5.5.5-10.0.10-MariaDB-1~saucy-log
This commit is contained in:
Petr Škoda 2014-04-14 09:36:18 +08:00
parent 069fe267b6
commit 6b7da257af

View File

@ -81,7 +81,7 @@ class mariadb_native_moodle_database extends mysqli_native_moodle_database {
public function get_server_info() {
$version = $this->mysqli->server_info;
$matches = null;
if (preg_match('/^5\.5\.5-(10\..+)-MariaDB$/i', $version, $matches)) {
if (preg_match('/^5\.5\.5-(10\..+)-MariaDB/i', $version, $matches)) {
// Looks like MariaDB decided to use these weird version numbers for better BC with MySQL...
$version = $matches[1];
}