From e294145a2bdf52753ad0ca55d8091e8160068490 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 13 Jun 2021 08:26:05 +0200 Subject: [PATCH] ip-lib doesn't except on the matches interfaces --- lib/Persistence/TrafficLimiter.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/Persistence/TrafficLimiter.php b/lib/Persistence/TrafficLimiter.php index 930272d..4f11ec7 100644 --- a/lib/Persistence/TrafficLimiter.php +++ b/lib/Persistence/TrafficLimiter.php @@ -13,7 +13,6 @@ namespace PrivateBin\Persistence; -use Exception; use IPLib\Factory; use PrivateBin\Configuration; @@ -133,13 +132,7 @@ class TrafficLimiter extends AbstractPersistence 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); - } catch (Exception $e) { - // If something is wrong with matching the ip, we assume it doesn't match - return false; - } + return $address->matches($range); } /** @@ -149,7 +142,6 @@ class TrafficLimiter extends AbstractPersistence * * @access public * @static - * @throws Exception * @return bool */ public static function canPass()