r96386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96385‎ | r96386 | r96387 >
Date:23:15, 6 September 2011
Author:aaron
Status:ok (Comments)
Tags:brion 
Comment:
Fixed typo in ipv6 private IP range list and added test (bug 30739)
Modified paths:
  • /trunk/phase3/includes/IP.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/IPTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/IPTest.php
@@ -272,10 +272,14 @@
273273 * @covers IP::isPublic
274274 */
275275 public function testPrivateIPs() {
276 - $private = array( 'fc::3', 'fc::ff', '::1', '10.0.0.1', '172.16.0.1', '192.168.0.1' );
 276+ $private = array( 'fc00::3', 'fc00::ff', '::1', '10.0.0.1', '172.16.0.1', '192.168.0.1' );
277277 foreach ( $private as $p ) {
278278 $this->assertFalse( IP::isPublic( $p ), "$p is not a public IP address" );
279279 }
 280+ $public = array( '2001:5c0:1000:a::133', 'fc::3' );
 281+ foreach ( $public as $p ) {
 282+ $this->assertTrue( IP::isPublic( $p ), "$p is a public IP address" );
 283+ }
280284 }
281285
282286 // Private wrapper used to test CIDR Parsing.
Index: trunk/phase3/includes/IP.php
@@ -378,7 +378,7 @@
379379 static $privateRanges = false;
380380 if ( !$privateRanges ) {
381381 $privateRanges = array(
382 - array( 'fc::', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local)
 382+ array( 'fc00::', 'fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ), # RFC 4193 (local)
383383 array( '0:0:0:0:0:0:0:1', '0:0:0:0:0:0:0:1' ), # loopback
384384 );
385385 }

Sign-offs

UserFlagDate
Catropeinspected13:18, 7 September 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r96487complement r96386 testshashar20:28, 7 September 2011
r965121.18: MFT r95655, r96227, r96386, r96393, r96405, r96427, r96460, r96472. And...catrope22:18, 7 September 2011
r96559MFT r92422, r93520, r93563, r94107, r94433, r95042, r95332, r95451, r96386...reedy12:49, 8 September 2011
r968561.17wmf1: MFT r94212, r96373, r96386, r96389, r96420, r96645...reedy15:35, 12 September 2011

Comments

#Comment by Hashar (talk | contribs)   20:29, 7 September 2011

I should have catched this error on review. Or maybe I did code that part :-(

Thanks Aaron for fixing this!

Status & tagging log