Don't accept duplicate pings

git-svn-id: http://svn.automattic.com/wordpress/trunk@2080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-11 02:56:43 +00:00
parent d1db85ccf2
commit 3c34012a6b
1 changed files with 4 additions and 0 deletions

View File

@ -80,6 +80,10 @@ if ( !empty($tb_url) && !empty($title) && !empty($tb_url) ) {
$comment_content = "<strong>$title</strong>\n\n$excerpt"; $comment_content = "<strong>$title</strong>\n\n$excerpt";
$comment_type = 'trackback'; $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'); $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type');
wp_new_comment($commentdata); wp_new_comment($commentdata);