This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: Getting rid of comment spammers
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
I seem to be in a battle with comment spammers.
I installed MT-Blacklist, which is great.
However I still get some annoying comments slip through the net.
I was talking with Cedric about this (since he uses MT too) and quickly hacked MT to NOT show any links, as that is what the comment spammers want (to have links back to their site... to try to fool Google).
So, I edited:
lib/MT/Template/Context.pm:
and changed the following:
sub _hdlr_comment_author_link {
sanitize_on($_[1]);
my($ctx, $args) = @_;
my $tag = $ctx->stash('tag');
my $c = $ctx->stash($tag =~ /Preview/ ? 'comment_preview' : 'comment')
or return $ctx->_no_comment_error('MT' . $tag);
my $name = $c->author;
$name = '' unless defined $name;
my $show_email = 1 unless exists $args->{show_email};
# my $show_url = 1 unless exists $args->{show_url};
# if ($show_url && $c->url) {
# my $url = remove_html($c->url);
# return sprintf qq(%s), $url, $name;
if ($show_email && $c->email) {
my $email = remove_html($c->email);
my $str = "mailto:" . $email;
$str = spam_protect($str) if $args->{'spam_protect'};
return sprintf qq(%s), $str, $name;
} else {
return $name;
}
}
I also edited the comment template to take out the URL field, since it isn't used now.
Damn spammers.
Dion