r18222 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18221‎ | r18222 | r18223 >
Date:10:30, 8 December 2006
Author:werdna
Status:old
Tags:
Comment:
Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist).
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/IP.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Block.php
@@ -455,14 +455,16 @@
456456 $wlEntry = substr($line, 1);
457457 $wlEntry = trim($wlEntry);
458458
459 - wfDebug("Checking $wlEntry\n");
 459+ wfDebug("Checking $ip against $wlEntry...");
460460
461461 # Is the IP in this range?
462462 if (IP::isInRange( $ip, $wlEntry )) {
463 - wfDebug("IP $ip matches $wlEntry, not autoblocking\n");
 463+ wfDebug(" IP $ip matches $wlEntry, not autoblocking\n");
464464 #$autoblockip = null; # Don't autoblock a whitelisted IP.
465465 return; #This /SHOULD/ introduce a dummy block - but
466466 # I don't know a safe way to do so. -werdna
 467+ } else {
 468+ wfDebug( " No match\n" );
467469 }
468470 }
469471
Index: trunk/phase3/includes/IP.php
@@ -223,6 +223,9 @@
224224 $unsignedIP = IP::toUnsigned($addr);
225225 list( $start, $end ) = IP::parseRange($range);
226226
 227+ $start = hexdec($start);
 228+ $end = hexdec($end);
 229+
227230 return (($unsignedIP >= $start) && ($unsignedIP <= $end));
228231 }
229232

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r17927* Added temporary special-case AOL proxy detection, they're automatically cou...tstarling16:24, 25 November 2006