more robust .yaml filename checker

This commit is contained in:
Andy Miller
2016-01-09 15:30:45 -07:00
parent beb01589eb
commit 196b6736ab

View File

@@ -727,12 +727,10 @@ class Admin
/** @var \DirectoryIterator $directory */
foreach (new \DirectoryIterator($path) as $file) {
if ($file->isDir() || $file->isDot() || $file->getBasename()[0] == '.') {
if ($file->isDir() || $file->isDot() || !preg_match('/^[^.].*.yaml$/', $file)) {
continue;
}
$configurations[] = basename($file->getBasename(), '.yaml');
}
return $configurations;