[wp-trac] [WordPress Trac] #3262: IPv6 address handling

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 19 11:39:34 GMT 2006


#3262: IPv6 address handling
-------------------------+--------------------------------------------------
 Reporter:  markjaquith  |       Owner:  anonymous    
     Type:  defect       |      Status:  new          
 Priority:  normal       |   Milestone:  2.1          
Component:  General      |     Version:  2.1          
 Severity:  normal       |    Keywords:  ipv6 comments
-------------------------+--------------------------------------------------
 We're blocking IPv6 addresses for comments.

 {{{
 powerbook:~/sites/wordpress/trunk mark$ grep -iR 'REMOTE_ADDR' * | grep -v
 '/.svn/'
 wp-content/plugins/akismet/akismet.php: $comment['user_ip']    =
 preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] );
 wp-includes/comment.php:                $comment_author_IP = preg_replace(
 '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
 wp-includes/comment.php:        $commentdata['comment_author_IP'] =
 preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
 }}}

 Suggested filtering function:

 {{{
 // sanitizes IP addresses (IPv4 + IPv6)
 function sanitize_ip($ip) {
         preg_match('/[0-9.a-f:]*/i', $ip, $matches);
         return $matches[0];
 }
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3262>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list