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:
parent
3e9c8dd010
commit
986cc7d505
|
@ -493,7 +493,7 @@ function wp_allow_comment($commentdata) {
|
||||||
|
|
||||||
// Simple duplicate check
|
// Simple duplicate check
|
||||||
// expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)
|
// 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 )
|
if ( $comment_author_email )
|
||||||
$dupe .= "OR comment_author_email = '$comment_author_email' ";
|
$dupe .= "OR comment_author_email = '$comment_author_email' ";
|
||||||
$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
|
$dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
|
||||||
|
|
Loading…
Reference in New Issue