Make WordPress Core

Ticket #22979: 22979.diff

File 22979.diff, 792 bytes (added by MikeHansenMe, 12 years ago)

Updated relative to root

  • wp-includes/comment.php

     
    13851385        $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
    13861386
    13871387        $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
    1388         $commentdata['comment_agent']     = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
     1388        $commentdata['comment_agent']     = ( isset($_SERVER['HTTP_USER_AGENT']) ? substr($_SERVER['HTTP_USER_AGENT'], 0, 254) : '' );
    13891389
    13901390        $commentdata['comment_date']     = current_time('mysql');
    13911391        $commentdata['comment_date_gmt'] = current_time('mysql', 1);