mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Check for empty user agent to avoid notice.
Props sergej.mueller fixes #22979 git-svn-id: http://core.svn.wordpress.org/trunk@24275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ac37e4b6dc
commit
7a1bc5769e
@ -1385,7 +1385,7 @@ function wp_new_comment( $commentdata ) {
|
||||
$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'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
|
||||
$commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '';
|
||||
|
||||
$commentdata['comment_date'] = current_time('mysql');
|
||||
$commentdata['comment_date_gmt'] = current_time('mysql', 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user