WordPress.org

Make WordPress Core

Ticket #10389: 10389.diff

File 10389.diff, 1.4 KB (added by Denis-de-Bernardy, 9 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);
  • wp-admin/import/livejournal.php

     
    618618                                                'comment_author_IP' => ( !empty( $comment_author_IP ) ? $comment_author_IP : '' ),
    619619                                                'comment_approved' => ( in_array( $lj_comment_state, array( 'A', 'F' ) ) ? 1 : 0 ),
    620620                                                'comment_karma' => $lj_comment_ID, // Need this and next value until rethreading is done
    621                                                 'comment_agent' => $lj_comment_parent,
     621                                                'comment_agent' => substr($lj_comment_parent, 0, 255),
    622622                                                'comment_type' => 'livejournal',  // Custom type, so we can find it later for processing
    623623                                                'user_ID' => $user_id
    624624                                        );