X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/75196e76b627709a6ecae3fa948e1fba7928a5ce..c69120058ba671e1c6863796b511710f5df3efa2:/IkiWiki/Plugin/blogspam.pm diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index f0b6cb2a2..e48ed729f 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -53,6 +53,7 @@ sub checkconfig () { eval q{ use RPC::XML; use RPC::XML::Client; + $RPC::XML::ENCODING = 'utf-8'; }; error $@ if $@; } @@ -61,12 +62,18 @@ sub checkcontent (@) { my %params=@_; my $session=$params{session}; - if (exists $config{blogspam_pagespec}) { - return undef - if ! pagespec_match($params{page}, $config{blogspam_pagespec}, - location => $params{page}); + my $spec='!admin()'; + if (exists $config{blogspam_pagespec} && + length $config{blogspam_pagespec}) { + $spec.=" and (".$config{blogspam_pagespec}.")"; } + my $user=$session->param("name"); + return undef unless pagespec_match($params{page}, $spec, + (defined $user ? (user => $user) : ()), + (defined $session->remote_addr() ? (ip => $session->remote_addr()) : ()), + location => $params{page}); + my $url=$defaulturl; $url = $config{blogspam_server} if exists $config{blogspam_server};