Test if $casSettings['user_whitelist'] is an array - and then perform in_array(...) instead of just checking if it's != null.

This commit is contained in:
mmn 2017-12-17 17:37:24 +00:00
parent 6ca5bb4d41
commit 1e1543dd72

View File

@ -41,7 +41,7 @@ class CasloginAction extends Action
$this->serverError(_m('Incorrect username or password.')); $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.) // 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.')); $this->serverError(_m('Incorrect username or password.'));
} }