Make WordPress Core

Ticket #4579: comment-ipv6-patch.patch

File comment-ipv6-patch.patch, 1.2 KB (added by OverlordQ, 15 years ago)

ipv6 patch

  • wp-includes/comment.php

     
    334334       extract($commentdata, EXTR_SKIP);
    335335
    336336       if ( ! isset($comment_author_IP) )
    337                $comment_author_IP = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
     337               $comment_author_IP = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
    338338       if ( ! isset($comment_date) )
    339339               $comment_date = current_time('mysql');
    340340       if ( ! isset($comment_date_gmt) )
     
    389389       $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];
    390390       $commentdata['user_ID']         = (int) $commentdata['user_ID'];
    391391
    392        $commentdata['comment_author_IP'] = preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] );
     392       $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
    393393       $commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT'];
    394394
    395395       $commentdata['comment_date']     = current_time('mysql');