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
This commit is contained in:
azaozz 2009-11-21 11:31:21 +00:00
parent 3e9c8dd010
commit 986cc7d505
1 changed files with 1 additions and 1 deletions

View File

@ -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";