From: Andrew Garrett Date: Fri, 8 Dec 2006 10:30:50 +0000 (+0000) Subject: Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist). X-Git-Tag: 1.31.0-rc.0~54960 X-Git-Url: https://git.cyclocoop.org/%20%27.%28%24debut%20%20%20%24par_page%29.%27?a=commitdiff_plain;h=bafa087e99d3d87011340dff30304bcfa692ec30;p=lhc%2Fweb%2Fwiklou.git Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist). --- diff --git a/includes/Block.php b/includes/Block.php index b06c8cabcf..ff813ba3e4 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -455,14 +455,16 @@ class Block $wlEntry = substr($line, 1); $wlEntry = trim($wlEntry); - wfDebug("Checking $wlEntry\n"); + wfDebug("Checking $ip against $wlEntry..."); # Is the IP in this range? if (IP::isInRange( $ip, $wlEntry )) { - wfDebug("IP $ip matches $wlEntry, not autoblocking\n"); + wfDebug(" IP $ip matches $wlEntry, not autoblocking\n"); #$autoblockip = null; # Don't autoblock a whitelisted IP. return; #This /SHOULD/ introduce a dummy block - but # I don't know a safe way to do so. -werdna + } else { + wfDebug( " No match\n" ); } } diff --git a/includes/IP.php b/includes/IP.php index b34cc78508..16fae9ca2e 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -223,6 +223,9 @@ class IP { $unsignedIP = IP::toUnsigned($addr); list( $start, $end ) = IP::parseRange($range); + $start = hexdec($start); + $end = hexdec($end); + return (($unsignedIP >= $start) && ($unsignedIP <= $end)); }