Truncate comment agent when longer than 255 chars, props Denis-de-Bernardy, fixes #10389

git-svn-id: https://develop.svn.wordpress.org/trunk@11713 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-07-14 08:20:24 +00:00
parent f6aaf08cbf
commit 3cd210f180
1 changed files with 1 additions and 1 deletions

View File

@ -983,7 +983,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'] = $_SERVER['HTTP_USER_AGENT'];
$commentdata['comment_agent'] = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
$commentdata['comment_date'] = current_time('mysql');
$commentdata['comment_date_gmt'] = current_time('mysql', 1);