• Hello,

    I posted a post yesturday regarding posting comments causing a DB error. Apparantly this was turned into a bug that was patched.

    Here is the link to my post yesturday:

    Here is the link to the bug issue:

    I am not sure how to get this applied? any help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • open the file mentioned:

    Index: wp-includes/comment.php
    ===================================================================
    --- wp-includes/comment.php	(revision 2072)
    +++ wp-includes/comment.php	(working copy)
    @@ -983,7 +983,7 @@
     	$commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
    
     	$commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
    -	$commentdata['comment_agent']     = $_SERVER['HTTP_USER_AGENT'];
    +	$commentdata['comment_agent']     = substr($_SERVER['HTTP_USER_AGENT'], 0, 255);
    
     	$commentdata['comment_date']     = current_time('mysql');
     	$commentdata['comment_date_gmt'] = current_time('mysql', 1);

    find this line:

    $commentdata['comment_agent'] = $_SERVER['HTTP_USER_AGENT'];

    remove it and replace it with this line:

    $commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 255);

    and that all needs to be on the same line, copy it off trac if you need to.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How Do I Apply This Bug Patch?’ is closed to new replies.