From cf0effd0e8d92dc9a55d45e85ac458b363dea070 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Sat, 19 Feb 2022 10:47:07 +0100 Subject: [PATCH] allowing for multiple comma separated CIDR ranges --- inc/core.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inc/core.php b/inc/core.php index 741f5bf..79bce76 100644 --- a/inc/core.php +++ b/inc/core.php @@ -601,6 +601,15 @@ function deleteHash($hash) * via https://stackoverflow.com/a/56050595/1174516 */ function isIPInRange( $ip, $range ) { + + if(substr(',',$range)!==false) + { + // we got a list of ranges. splitting + $ranges = array_map('trim',explode(',',$range)); + foreach($ranges as $range) + if(isIPInRange($ip,$range)) return true; + return false; + } // Get mask bits list($net, $maskBits) = explode('/', $range);