From 502bb5fa15b12a232c720bf787ef45f898196934 Mon Sep 17 00:00:00 2001 From: Rodehoed Date: Thu, 6 May 2021 12:18:44 +0200 Subject: [PATCH] Put the ip-matching function in a private function --- lib/Persistence/TrafficLimiter.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Persistence/TrafficLimiter.php b/lib/Persistence/TrafficLimiter.php index cbe6adf3..39755404 100644 --- a/lib/Persistence/TrafficLimiter.php +++ b/lib/Persistence/TrafficLimiter.php @@ -112,8 +112,8 @@ class TrafficLimiter extends AbstractPersistence * * @access private * @static - * @param string $algo - * @return string + * @param string $ipRange + * @return bool */ private static function matchIp($ipRange = null) { @@ -156,13 +156,12 @@ class TrafficLimiter extends AbstractPersistence if (self::$_limit < 1) { return true; } - error_reporting(-1); + // Check if $_ipKey is exempted from ratelimiting if (!is_null(self::$_exemptedIp)) { $exIp_array = explode(',', self::$_exemptedIp); foreach ($exIp_array as $ipRange) { - if (self::matchIp($ipRange) === true) - { + if (self::matchIp($ipRange) === true) { return true; } }