From 1e1543dd72be4d45236e2e3a53452a969f50cdb3 Mon Sep 17 00:00:00 2001 From: mmn Date: Sun, 17 Dec 2017 17:37:24 +0000 Subject: [PATCH] Test if $casSettings['user_whitelist'] is an array - and then perform in_array(...) instead of just checking if it's != null. --- plugins/CasAuthentication/actions/caslogin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CasAuthentication/actions/caslogin.php b/plugins/CasAuthentication/actions/caslogin.php index 9250b43b7a..468718b4c9 100644 --- a/plugins/CasAuthentication/actions/caslogin.php +++ b/plugins/CasAuthentication/actions/caslogin.php @@ -41,7 +41,7 @@ class CasloginAction extends Action $this->serverError(_m('Incorrect username or password.')); } - if ($casSettings['user_whitelist'] != null && !in_array($user->nickname, $casSettings['user_whitelist'])) { + if (is_array($casSettings['user_whitelist']) && !in_array($user->nickname, $casSettings['user_whitelist'])) { // TRANS: Server error displayed when trying to log in with non-whitelisted user name (when whitelists are enabled.) $this->serverError(_m('Incorrect username or password.')); }