From cd02bd0702c000f8f3fb6a492044c098df4678cd Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 21 Jan 2015 23:17:08 +0000 Subject: [PATCH] Comments: When a comment fails to insert, remove invalid characters from the email and URL fields, too. See [31263], #21212 git-svn-id: https://develop.svn.wordpress.org/trunk@31264 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 693af2e9e6..2e0fdb7f24 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -1925,7 +1925,7 @@ function wp_insert_comment( $commentdata ) { $compacted = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id' ); if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) { - $fields = array( 'comment_author', 'comment_content' ); + $fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' ); foreach( $fields as $field ) { if ( isset( $compacted[ $field ] ) ) {