Simplify array filter

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/22280/head
Joas Schilling 2020-03-19 14:14:37 +07:00
parent dfeee3b850
commit d9c4c9eb99
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 1 additions and 2 deletions

@ -162,8 +162,7 @@ class Throttler {
$keys = $this->config->getAppKeys('bruteForce');
$keys = array_filter($keys, function ($key) {
$regex = '/^whitelist_/S';
return preg_match($regex, $key) === 1;
return 0 === strpos($key, 'whitelist_');
});
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {