mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-10-01 01:26:10 -04:00
Put the ip-matching function in a private function
This commit is contained in:
parent
89bdc92451
commit
502bb5fa15
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user