summaryrefslogtreecommitdiffstats
path: root/lib/private/Security/Bruteforce/Throttler.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Security/Bruteforce/Throttler.php')
-rw-r--r--lib/private/Security/Bruteforce/Throttler.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Security/Bruteforce/Throttler.php b/lib/private/Security/Bruteforce/Throttler.php
index 3282121d967..ec56b4f7ee2 100644
--- a/lib/private/Security/Bruteforce/Throttler.php
+++ b/lib/private/Security/Bruteforce/Throttler.php
@@ -177,8 +177,10 @@ class Throttler {
$part = ord($addr[(int)($i/8)]);
$orig = ord($ip[(int)($i/8)]);
- $part = $part & (15 << (1 - ($i % 2)));
- $orig = $orig & (15 << (1 - ($i % 2)));
+ $bitmask = 1 << (7 - ($i % 8));
+
+ $part = $part & $bitmask;
+ $orig = $orig & $bitmask;
if ($part !== $orig) {
$valid = false;