Opened 18 years ago
Closed 17 years ago
#3262 closed defect (bug) (duplicate)
IPv6 address handling
Reported by: |
|
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)
Note: See
TracTickets for help on using
tickets.
Duplicated by #4579 but closing this ticket as actual work has been done there.