Make WordPress Core

Opened 18 years ago

Closed 17 years ago

#3262 closed defect (bug) (duplicate)

IPv6 address handling

Reported by: markjaquith's profile markjaquith Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1
Component: General Keywords: ipv6 comments
Focuses: Cc:

Description

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];
}

Change History (3)

#1 @matt
18 years ago

  • Milestone changed from 2.1 to 2.2

#2 @foolswisdom
18 years ago

  • Milestone changed from 2.2 to 2.4

#3 @pishmishy
17 years ago

  • Milestone 2.4 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicated by #4579 but closing this ticket as actual work has been done there.

Note: See TracTickets for help on using tickets.