X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fbadword.pl;h=751e4d44624103f1cf194c67f174f35c6449b424;hb=bb3889c1d4930e2ca96b47aea10ce5e803737043;hp=21a38a3ca5a4e235b1980797c4cbadb60e7998d3;hpb=17f0b57add792391822d38116e89b33c1df4e2dd;p=spider.git diff --git a/cmd/set/badword.pl b/cmd/set/badword.pl index 21a38a3c..751e4d44 100644 --- a/cmd/set/badword.pl +++ b/cmd/set/badword.pl @@ -3,8 +3,29 @@ # # Copyright (c) 1998 - Dirk Koopman G1TLH # -# $Id$ +# # my ($self, $line) = @_; -return $BadWords::badword->set(8, $self->msg('e6'), $self, $line); - +return (1, $self->msg('e5')) if $self->remotecmd; +# are we permitted? +return (1, $self->msg('e5')) if $self->priv < 6; +my @words = split /\s+/, uc $line; +my @out; +my $count = 0; +foreach my $w (@words) { + my @in; + + if (@in = BadWords::check($w)) { + push @out, "BadWord $w already matched by '$in[0]', ignored"; + } else { + @in = BadWords::add_regex($w); + push @out, "BadWord $w added as '$in[0]'"; + $count++; + } +} +if ($count) { + BadWords::generate_regex(); + BadWords::put(); +} +return (1, @out); +