Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist).
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 8 Dec 2006 10:30:50 +0000 (10:30 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 8 Dec 2006 10:30:50 +0000 (10:30 +0000)
includes/Block.php
includes/IP.php

index b06c8ca..ff813ba 100644 (file)
@@ -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" );
                        }
                }
 
index b34cc78..16fae9c 100644 (file)
@@ -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));
     }