From 95b7e055cedb46ea92d2a8696c07949d0e3deb0a Mon Sep 17 00:00:00 2001 From: westi Date: Mon, 21 Dec 2009 15:35:00 +0000 Subject: [PATCH] Check that there is a comment_agent to filter and otherwise filter an empty string. Fixes a notice during import from old WXR files. See #11484. git-svn-id: http://svn.automattic.com/wordpress/trunk@12470 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 2024c13ef..bdf090749 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1137,7 +1137,7 @@ function wp_filter_comment($commentdata) { $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_ID']); elseif ( isset($commentdata['user_id']) ) $commentdata['user_id'] = apply_filters('pre_user_id', $commentdata['user_id']); - $commentdata['comment_agent'] = apply_filters('pre_comment_user_agent', $commentdata['comment_agent']); + $commentdata['comment_agent'] = apply_filters('pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) ); $commentdata['comment_author'] = apply_filters('pre_comment_author_name', $commentdata['comment_author']); $commentdata['comment_content'] = apply_filters('pre_comment_content', $commentdata['comment_content']); $commentdata['comment_author_IP'] = apply_filters('pre_comment_user_ip', $commentdata['comment_author_IP']);