From 986cc7d505e0521445afbf76f92325355f76f65f Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 21 Nov 2009 11:31:21 +0000 Subject: [PATCH] Ignore trashed comments for duplicate comment check, props scribu, fixes #10944 git-svn-id: http://svn.automattic.com/wordpress/trunk@12254 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 6af1492d3..ad9d50bf3 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -493,7 +493,7 @@ function wp_allow_comment($commentdata) { // Simple duplicate check // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content) - $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND ( comment_author = '$comment_author' "; + $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' "; if ( $comment_author_email ) $dupe .= "OR comment_author_email = '$comment_author_email' "; $dupe .= ") AND comment_content = '$comment_content' LIMIT 1";