Permalink
Browse files

Don't accept duplicate pings

git-svn-id: http://svn.automattic.com/wordpress/trunk@2080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent d1db85c commit 3c34012a6b3d9814f362a0f224ca6d60e76bf2b0 saxmatt committed Jan 11, 2005
Showing with 4 additions and 0 deletions.
  1. +4 −0 wp-trackback.php
View
@@ -80,6 +80,10 @@ function trackback_response($error = 0, $error_message = '') {
$comment_content = "<strong>$title</strong>\n\n$excerpt";
$comment_type = 'trackback';
+ $dupe = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_author_url = '$comment_author_url'");
+ if ( $dupe )
+ trackback_response(1, 'We already have a ping from that URI for this post.');
+
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type');
wp_new_comment($commentdata);

0 comments on commit 3c34012

Please sign in to comment.