Skip to content

Commit

Permalink
fix getMariaDbMysqlVersionNumber(), because sometimes $versionString …
Browse files Browse the repository at this point in the history
…may not have a patch version, in which case $versionParts will be `[]`.
  • Loading branch information
[email protected] authored and [email protected] committed Sep 10, 2024
1 parent c6080c2 commit 3e27a78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Provider/Doctrine/Persistence/Helper/PlatformHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ public static function getOracleMysqlVersionNumber(string $versionString): strin
public static function getMariaDbMysqlVersionNumber(string $versionString): string
{
preg_match(
'#^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)#i',
'#^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))?#i',
$versionString,
$versionParts
);

return $versionParts['major'].'.'.$versionParts['minor'].'.'.$versionParts['patch'];
return $versionParts['major'].'.'.$versionParts['minor'].'.'.($versionParts['patch'] ?? '0');
}
}

0 comments on commit 3e27a78

Please sign in to comment.