From af5a14afc31474572e076c498cba47cb418a35de Mon Sep 17 00:00:00 2001 From: rodehoed <6515395+rodehoed@users.noreply.github.com> Date: Wed, 19 May 2021 09:01:45 +0200 Subject: [PATCH] Optimized the canPass() functions --- lib/Persistence/TrafficLimiter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Persistence/TrafficLimiter.php b/lib/Persistence/TrafficLimiter.php index 34584b5..af6e497 100644 --- a/lib/Persistence/TrafficLimiter.php +++ b/lib/Persistence/TrafficLimiter.php @@ -122,7 +122,9 @@ class TrafficLimiter extends AbstractPersistence $range = \IPLib\Factory::rangeFromString(trim($ipRange)); // If $range is null something went wrong (possible invalid ip given in config). It's here becaue matches($range) does not accepts null vallue - if ($range == null) return false; + if ($range == null) { + return false; + } // Ip-lib does throws and exception when something goes wrong, if so we want to catch it and set contained to false try {