Skip to content
Snippets Groups Projects
Unverified Commit d9c4c9eb authored by Joas Schilling's avatar Joas Schilling
Browse files

Simplify array filter

parent dfeee3b8
No related branches found
No related tags found
No related merge requests found
...@@ -162,8 +162,7 @@ class Throttler { ...@@ -162,8 +162,7 @@ class Throttler {
$keys = $this->config->getAppKeys('bruteForce'); $keys = $this->config->getAppKeys('bruteForce');
$keys = array_filter($keys, function ($key) { $keys = array_filter($keys, function ($key) {
$regex = '/^whitelist_/S'; return 0 === strpos($key, 'whitelist_');
return preg_match($regex, $key) === 1;
}); });
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment