Ticket #4579: 4579.patch

File 4579.patch, 564 bytes (added by pishmishy, 4 years ago)

revised regular expression

  • 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) )