
brion at svn
Aug 3, 2007, 1:51 AM
Post #1 of 1
(125 views)
Permalink
|
|
SVN: [24561] trunk/phase3
|
|
Revision: 24561 Author: brion Date: 2007-08-03 08:51:55 +0000 (Fri, 03 Aug 2007) Log Message: ----------- * Fixed regression in blocking of username '0' IP::sanitizeIP() for some reason is used to return IP-or-something-that's-not-an-IP, but was incorrectly checking for empties. Thus for '0' input it returned NULL instead of '0'. Modified Paths: -------------- trunk/phase3/RELEASE-NOTES trunk/phase3/includes/IP.php Modified: trunk/phase3/RELEASE-NOTES =================================================================== --- trunk/phase3/RELEASE-NOTES 2007-08-03 08:48:06 UTC (rev 24560) +++ trunk/phase3/RELEASE-NOTES 2007-08-03 08:51:55 UTC (rev 24561) @@ -346,7 +346,9 @@ * Toggles in RTL preferences indented to the right, hidden in IE in some cases. * Fix RTL display of the upload form. +* Fixed regression in blocking of username '0' + == API changes since 1.10 == Full API documentation is available at http://www.mediawiki.org/wiki/API Modified: trunk/phase3/includes/IP.php =================================================================== --- trunk/phase3/includes/IP.php 2007-08-03 08:48:06 UTC (rev 24560) +++ trunk/phase3/includes/IP.php 2007-08-03 08:51:55 UTC (rev 24561) @@ -114,13 +114,14 @@ * @return string */ public static function sanitizeIP( $ip ) { - if ( !$ip ) return null; + $ip = trim( $ip ); + if ( $ip === '' ) return null; // Trim and return IPv4 addresses - if ( self::isIPv4($ip) ) return trim($ip); + if ( self::isIPv4($ip) ) return $ip; // Only IPv6 addresses can be expanded if ( !self::isIPv6($ip) ) return $ip; // Remove any whitespaces, convert to upper case - $ip = strtoupper( trim($ip) ); + $ip = strtoupper( $ip ); // Expand zero abbreviations if ( strpos( $ip, '::' ) !== false ) { $ip = str_replace('::', str_repeat(':0', 8 - substr_count($ip, ':')) . ':', $ip); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS [at] lists http://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
|