mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 10:56:08 +01:00
more robust .yaml filename checker
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user