From: Aaron Schulz Date: Tue, 13 Mar 2007 22:29:08 +0000 (+0000) Subject: *check for sanitized IPv6 IPs X-Git-Tag: 1.31.0-rc.0~53770 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0dbe206931837a7d383382a4927e9395b9672640;p=lhc%2Fweb%2Fwiklou.git *check for sanitized IPv6 IPs --- diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index f1da5d5dec..d59eb78c76 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -76,6 +76,9 @@ class ContribsFinder { if( substr( $this->username, -2 ) == 24 ) $ipmask = $abcd[0] . '.' . $abcd[1] . '.' . $abcd[2] . '.%'; else $ipmask=$abcd[0] . '.' . $abcd[1] . '.%'; $condition = 'rev_user_text LIKE ' . $this->dbr->addQuotes($ipmask); + } else if ( IP::isIPv6( $this->username ) ) { + # All stored IPs should be sanitized from now on, check for exact matches for reverse compatibility + $condition = '(rev_user_text=' . $this->dbr->addQuotes(IP::sanitizeIP($this->username)) . ' OR rev_user_text=' . $this->dbr->addQuotes($this->username) . ')'; } if ( $condition == '' ) {