Permalink
Browse files

Prevent adding trackbacks we already have, coming from the same URL and

pointing to the same article.
  • Loading branch information...
brockhaus committed Jan 25, 2012
1 parent e5c85dc commit 11ab4cc8c46c1259a98bf065bdca4bf70c30fe4f
Showing with 14 additions and 2 deletions.
  1. +14 −2 include/functions_trackbacks.inc.php
@@ -362,8 +362,20 @@ function add_trackback ($id, $title, $url, $name, $excerpt) {
fclose($fp);
}
serendipity_saveComment($id, $comment, 'TRACKBACK');
if ($id>0) {
// first check, if we already have this trackback
$comments = serendipity_fetchComments($id,1,'co.id',true,'TRACKBACK'," AND co.url='$url'");
if (is_array($comments) && sizeof($comments) == 1) {
log_pingback("We already have that TRACKBACK!");
return 0; // We already have it!
}
// We don't have it, so save the pingback
serendipity_saveComment($id, $comment, 'TRACKBACK');
return 1;
} else {
return 0;
}
return 1;
}

0 comments on commit 11ab4cc

Please sign in to comment.