From fe89161848298f9583384e62ed3d769dcce2eda1 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 26 Feb 2022 07:18:59 +0100 Subject: [PATCH] replace deprecated function calls --- lib/Persistence/TrafficLimiter.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Persistence/TrafficLimiter.php b/lib/Persistence/TrafficLimiter.php index d0b82be9..f071562b 100644 --- a/lib/Persistence/TrafficLimiter.php +++ b/lib/Persistence/TrafficLimiter.php @@ -15,6 +15,7 @@ namespace PrivateBin\Persistence; use Exception; use IPLib\Factory; +use IPLib\ParseStringFlag; use PrivateBin\Configuration; use PrivateBin\I18n; @@ -144,8 +145,8 @@ class TrafficLimiter extends AbstractPersistence if (is_string($ipRange)) { $ipRange = trim($ipRange); } - $address = Factory::addressFromString($_SERVER[self::$_ipKey]); - $range = Factory::rangeFromString($ipRange); + $address = Factory::parseAddressString($_SERVER[self::$_ipKey]); + $range = Factory::parseRangeString($ipRange, ParseStringFlag::IPV4_MAYBE_NON_DECIMAL); // address could not be parsed, we might not be in IP space and try a string comparison instead if (is_null($address)) {