Skip to content

Commit

Permalink
DbMigrationHook: Pad matching groups to the desired length before usi…
Browse files Browse the repository at this point in the history
…ng them
  • Loading branch information
yhabteab authored and nilmerg committed Sep 20, 2023
1 parent e4c9266 commit c3eef5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Icinga/Application/Hook/DbMigrationHook.php
Expand Up @@ -305,7 +305,8 @@ protected function load(): void
/** @var SplFileInfo $file */
foreach (new DirectoryIterator($path . DIRECTORY_SEPARATOR . $upgradeDir) as $file) {
if (preg_match('/^(v)?([^_]+)(?:_(\w+))?\.sql$/', $file->getFilename(), $m, PREG_UNMATCHED_AS_NULL)) {
[$_, $_, $migrateVersion, $description] = $m;
[$_, $_, $migrateVersion, $description] = array_pad($m, 4, null);
/** @var string $migrateVersion */
if ($migrateVersion && version_compare($migrateVersion, $version, '>')) {
$migration = new DbMigrationStep($migrateVersion, $file->getRealPath());
if (isset($descriptions[$migrateVersion])) {
Expand Down

0 comments on commit c3eef5f

Please sign in to comment.