mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
ip-lib doesn't except on the matches interfaces
This commit is contained in:
parent
cc6fb1c0c3
commit
e294145a2b
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
namespace PrivateBin\Persistence;
|
namespace PrivateBin\Persistence;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use IPLib\Factory;
|
use IPLib\Factory;
|
||||||
use PrivateBin\Configuration;
|
use PrivateBin\Configuration;
|
||||||
|
|
||||||
|
@ -133,13 +132,7 @@ class TrafficLimiter extends AbstractPersistence
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ip-lib throws an exception when something goes wrong, if so we want to catch it and set contained to false
|
|
||||||
try {
|
|
||||||
return $address->matches($range);
|
return $address->matches($range);
|
||||||
} catch (Exception $e) {
|
|
||||||
// If something is wrong with matching the ip, we assume it doesn't match
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -149,7 +142,6 @@ class TrafficLimiter extends AbstractPersistence
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
* @throws Exception
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function canPass()
|
public static function canPass()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user