From 73d8396553f7d2ab7416f5da9784e24c274166a7 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Sun, 17 Jan 2016 23:04:34 +0100 Subject: [PATCH] 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. --- admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin.php b/admin.php index 3c0fd923..67ece8c7 100644 --- a/admin.php +++ b/admin.php @@ -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); }