From: mmn Date: Sun, 17 Dec 2017 17:37:24 +0000 (+0000) Subject: Test if $casSettings['user_whitelist'] is an array - and then perform in_array(.... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1e1543dd72be4d45236e2e3a53452a969f50cdb3;p=quix0rs-gnu-social.git Test if $casSettings['user_whitelist'] is an array - and then perform in_array(...) instead of just checking if it's != null. --- 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.')); }