Unverified Commit 4f876ef0 authored by belgattitude's avatar belgattitude Committed by Luís Cobucci

RegExp change from @Majkl578 suggestion

parent 4747fd0c
...@@ -179,12 +179,10 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver, ...@@ -179,12 +179,10 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
*/ */
private function getMariaDbMysqlVersionNumber(string $versionString) : string private function getMariaDbMysqlVersionNumber(string $versionString) : string
{ {
$version = str_replace('5.5.5-', '', $versionString); if (!preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i', $versionString, $versionParts)) {
if (!preg_match('/^(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/', strtolower($version), $versionParts)) {
throw DBALException::invalidPlatformVersionSpecified( throw DBALException::invalidPlatformVersionSpecified(
$version, $versionString,
'(mariadb-)?<major_version>.<minor_version>.<patch_version>' '^(?:5\.5\.5-)?(mariadb-)?<major_version>.<minor_version>.<patch_version>'
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment