A free, self-hostable news aggregator…
fix: Ignore non-PHP files in migrations/ folder (#4163)
berumuronbc5271b0eb0e
diff --git a/lib/Minz/Migrator.php b/lib/Minz/Migrator.phpindex 7afc5240e..0f28237c5 100644--- a/lib/Minz/Migrator.php+++ b/lib/Minz/Migrator.php@@ -39,7 +39,8 @@ class Minz_Migrator$migration_files = scandir($migrations_path);$migration_files = array_filter($migration_files, function ($filename) {- return $filename[0] !== '.';+ $file_extension = pathinfo($filename, PATHINFO_EXTENSION);+ return $file_extension === 'php';});$migration_versions = array_map(function ($filename) {return basename($filename, '.php');@@ -134,7 +135,8 @@ class Minz_Migrator}foreach (scandir($directory) as $filename) {- if ($filename[0] === '.') {+ $file_extension = pathinfo($filename, PATHINFO_EXTENSION);+ if ($file_extension !== 'php') {continue;}diff --git a/tests/fixtures/migrations/2022_01_17_IgnoredFile b/tests/fixtures/migrations/2022_01_17_IgnoredFilenew file mode 100644index 000000000..e69de29bb