From d99df49ed73c2ba7ce8799c25cdd7987a025b454 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 31 May 2009 15:02:43 +0000 Subject: [PATCH] Fixes for r51236 per CR comments --- includes/IP.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/IP.php b/includes/IP.php index 355c7b68b3..a2a3547807 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -502,10 +502,10 @@ class IP { */ public static function isInRange( $addr, $range ) { // Convert to IPv6 if needed - $unsignedIP = self::toUnsigned( $addr ); + $hexIP = self::toHex( $addr ); list( $start, $end ) = self::parseRange( $range ); - return (($unsignedIP >= base_convert($start, 16, 10)) && - ($unsignedIP <= base_convert($end, 16, 10))); + return (strcmp($hexIP, $start) >= 0 && + strcmp($hexIP, $end) <= 0); } /** -- 2.20.1