summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-01-19 14:11:15 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-01-19 14:11:15 -0500
commit8360e96a8661d3cc0532f377db81a3f37babd126 (patch)
tree821673c36b1d516cc656a6cea308217db4bad949
parentd79b8f809abc89d954240b2299e4613a8272fc5e (diff)
blogspam: Log spam info on failure.
-rw-r--r--IkiWiki/Plugin/blogspam.pm9
-rw-r--r--debian/changelog1
2 files changed, 7 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm
index cc6e840f0..8462a6d1d 100644
--- a/IkiWiki/Plugin/blogspam.pm
+++ b/IkiWiki/Plugin/blogspam.pm
@@ -83,7 +83,7 @@ sub checkcontent (@) {
# and "buy".
push @options, "exclude=stopwords";
- my $res = $client->send_request('testComment', {
+ my %req={
ip => $ENV{REMOTE_ADDR},
comment => $params{content},
subject => defined $params{subject} ? $params{subject} : "",
@@ -92,17 +92,20 @@ sub checkcontent (@) {
options => join(",", @options),
site => $config{url},
version => "ikiwiki ".$IkiWiki::version,
- });
+ };
+ my $res = $client->send_request('testComment', %req);
if (! ref $res || ! defined $res->value) {
debug("failed to get response from blogspam server ($url)");
return undef;
}
elsif ($res->value =~ /^SPAM:(.*)/) {
+ eval q{use Data::Dumper};
+ debug("blogspam server reports ".$res->value.": ".Dumper(\%req));
return gettext("Sorry, but that looks like spam to <a href=\"http://blogspam.net/\">blogspam</a>: ").$1;
}
elsif ($res->value ne 'OK') {
- debug(gettext("blogspam server failure: ").$res->value);
+ debug("blogspam server failure: ".$res->value);
return undef;
}
else {
diff --git a/debian/changelog b/debian/changelog
index 6e8a54d9d..8bf45c30a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ ikiwiki (3.03) UNRELEASED; urgency=low
* Avoid feeding decoded unicode to Term::ReadLine.
Closes: 512169
+ * blogspam: Log spam info on failure.
-- Joey Hess <joeyh@debian.org> Sun, 18 Jan 2009 14:50:57 -0500