mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-04 14:50:59 +01:00
On Linux glob might return a ['0' => false] array
From the PHP manual: on some systems it is impossible to distinguish between empty match and an error.
This commit is contained in:
@@ -99,7 +99,7 @@ class AdminPlugin extends Plugin
|
||||
$user_check = (array) glob($account_dir . '/*.yaml');
|
||||
|
||||
// If no users found, go to register
|
||||
if (!count($user_check) > 0) {
|
||||
if (count($user_check) == 0 || (count($user_check) == 1 && reset($user_check) == false)) {
|
||||
if (!$this->isAdminPath()) {
|
||||
$this->grav->redirect($this->base);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user