r38739 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38738‎ | r38739 | r38740 >
Date:20:54, 6 August 2008
Author:brion
Status:old
Tags:
Comment:
* (bug 15049) Fix for CheckUser extension's log search: usernames containing
a "-" were incorrectly turned into bogus IP range searches.
Patch by Max Semenik.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/IP.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/IP.php
@@ -426,12 +426,16 @@
427427 } elseif ( strpos( $range, '-' ) !== false ) {
428428 # Explicit range
429429 list( $start, $end ) = array_map( 'trim', explode( '-', $range, 2 ) );
430 - $start = self::toUnsigned( $start ); $end = self::toUnsigned( $end );
431 - if ( $start > $end ) {
 430+ if( self::isIPAddress( $start ) && self::isIPAddress( $end ) ) {
 431+ $start = self::toUnsigned( $start ); $end = self::toUnsigned( $end );
 432+ if ( $start > $end ) {
 433+ $start = $end = false;
 434+ } else {
 435+ $start = sprintf( '%08X', $start );
 436+ $end = sprintf( '%08X', $end );
 437+ }
 438+ } else {
432439 $start = $end = false;
433 - } else {
434 - $start = sprintf( '%08X', $start );
435 - $end = sprintf( '%08X', $end );
436440 }
437441 } else {
438442 # Single IP
Index: trunk/phase3/RELEASE-NOTES
@@ -63,7 +63,11 @@
6464 * Special pages are now not subject to special handling for "self-links"
6565 * (bug 15053) Syntactically incorrect redirects with another link in them
6666 no longer redirect to the second link
 67+* (bug 15049) Fix for CheckUser extension's log search: usernames containing
 68+ a "-" were incorrectly turned into bogus IP range searches.
 69+ Patch by Max Semenik.
6770
 71+
6872 === API changes in 1.14 ===
6973
7074 * Registration time of users registered before the DB field was created is now

Follow-up revisions

RevisionCommit summaryAuthorDate
r38770Add Max Semenik to CREDITS per r38739catrope11:54, 7 August 2008

Status & tagging log