diff options
Diffstat (limited to 'modules-available/locations')
-rw-r--r-- | modules-available/locations/inc/locationutil.inc.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules-available/locations/inc/locationutil.inc.php b/modules-available/locations/inc/locationutil.inc.php index 17608203..91117445 100644 --- a/modules-available/locations/inc/locationutil.inc.php +++ b/modules-available/locations/inc/locationutil.inc.php @@ -169,7 +169,7 @@ class LocationUtil return ($net1['startaddr'] <= $net2['endaddr'] && $net1['endaddr'] >= $net2['startaddr']); } - public static function rangeToLongVerbose(int $start, int $end): ?array + public static function rangeToLongVerbose(string $start, string $end): ?array { $result = self::rangeToLong($start, $end); list($startLong, $endLong) = $result; @@ -188,16 +188,11 @@ class LocationUtil return $result; } - public static function rangeToLong(int $start, int $end): array + /** @return array{0: int, 1: int} */ + public static function rangeToLong(string $start, string $end): array { $startLong = ip2long($start); $endLong = ip2long($end); - if ($startLong !== false) { - $startLong = sprintf("%u", $startLong); - } - if ($endLong !== false) { - $endLong = sprintf("%u", $endLong); - } return array($startLong, $endLong); } |