WordPress.org

Make WordPress Core

Ticket #10389: 10389.2.diff

File 10389.2.diff, 727 bytes (added by Denis-de-Bernardy, 5 years ago)
  • wp-includes/comment.php

     
    983983        $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; 
    984984 
    985985        $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); 
    986         $commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT']; 
     986        $commentdata['comment_agent']     = substr($_SERVER['HTTP_USER_AGENT'], 0, 255); 
    987987 
    988988        $commentdata['comment_date']     = current_time('mysql'); 
    989989        $commentdata['comment_date_gmt'] = current_time('mysql', 1);