mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
more robust .yaml filename checker
This commit is contained in:
@@ -727,12 +727,10 @@ class Admin
|
|||||||
|
|
||||||
/** @var \DirectoryIterator $directory */
|
/** @var \DirectoryIterator $directory */
|
||||||
foreach (new \DirectoryIterator($path) as $file) {
|
foreach (new \DirectoryIterator($path) as $file) {
|
||||||
if ($file->isDir() || $file->isDot() || $file->getBasename()[0] == '.') {
|
if ($file->isDir() || $file->isDot() || !preg_match('/^[^.].*.yaml$/', $file)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$configurations[] = basename($file->getBasename(), '.yaml');
|
$configurations[] = basename($file->getBasename(), '.yaml');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configurations;
|
return $configurations;
|
||||||
|
|||||||
Reference in New Issue
Block a user