From bafa087e99d3d87011340dff30304bcfa692ec30 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 8 Dec 2006 10:30:50 +0000 Subject: [PATCH] Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist). --- includes/Block.php | 6 ++++-- includes/IP.php | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) 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)); } -- 2.20.1