r20411 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20410‎ | r20411 | r20412 >
Date:22:29, 13 March 2007
Author:aaron
Status:old
Tags:
Comment:
*check for sanitized IPv6 IPs
Modified paths:
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialContributions.php
@@ -76,6 +76,9 @@
7777 if( substr( $this->username, -2 ) == 24 ) $ipmask = $abcd[0] . '.' . $abcd[1] . '.' . $abcd[2] . '.%';
7878 else $ipmask=$abcd[0] . '.' . $abcd[1] . '.%';
7979 $condition = 'rev_user_text LIKE ' . $this->dbr->addQuotes($ipmask);
 80+ } else if ( IP::isIPv6( $this->username ) ) {
 81+ # All stored IPs should be sanitized from now on, check for exact matches for reverse compatibility
 82+ $condition = '(rev_user_text=' . $this->dbr->addQuotes(IP::sanitizeIP($this->username)) . ' OR rev_user_text=' . $this->dbr->addQuotes($this->username) . ')';
8083 }
8184
8285 if ( $condition == '' ) {