summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-03-19 14:14:37 +0100
committerJoas Schilling <coding@schilljs.com>2020-08-19 11:20:36 +0200
commitd9c4c9eb99943d642034ac88c11e399d5461f13a (patch)
tree8bf8eac599ccc2597391aa60e75c465047db3af5 /lib
parentdfeee3b85095c86f9077d00129d8717781f65c99 (diff)
downloadnextcloud-server-d9c4c9eb99943d642034ac88c11e399d5461f13a.tar.gz
nextcloud-server-d9c4c9eb99943d642034ac88c11e399d5461f13a.zip
Simplify array filter
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Security/Bruteforce/Throttler.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php
index 1e92eeed3b2..ef870f4b99a 100644
--- a/lib/private/Security/Bruteforce/Throttler.php
+++ b/lib/private/Security/Bruteforce/Throttler.php
@@ -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)) {