From: Roan Kattouw Date: Sun, 31 May 2009 15:02:43 +0000 (+0000) Subject: Fixes for r51236 per CR comments X-Git-Tag: 1.31.0-rc.0~41590 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=d99df49ed73c2ba7ce8799c25cdd7987a025b454;p=lhc%2Fweb%2Fwiklou.git Fixes for r51236 per CR comments --- 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); } /**