From 4d01cd49ed903eb89e9d6ecced22d9883a35e106 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 14 Oct 2012 17:06:37 +0000 Subject: [PATCH] Duplicate comments should be allowed under a different comment parent. props andy. fixes #21609. git-svn-id: https://develop.svn.wordpress.org/trunk@22229 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 225e786b43..7a8f71cfd4 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -669,7 +669,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_approved != 'trash' AND ( comment_author = '$comment_author' "; + $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_parent = '$comment_parent' 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";