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
This commit is contained in:
westi 2009-12-21 15:35:00 +00:00
parent cd4fd77beb
commit 95b7e055ce
1 changed files with 1 additions and 1 deletions

View File

@ -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']);