Kenji
kenji****@club*****
2006年 11月 1日 (水) 14:35:43 JST
Kenji です。 割と、spam が止まりません。 push(@spam_found, grep (/$word/i, $body)) ; のように、大文字小文字の区別はしない方がよくないでしょうか? On Wed, 5 Jul 2006 11:42:37 +0900 Kenji <kenji****@club*****> wrote: > Index: board.cgi.in > =================================================================== > RCS file: /cvsroot/h14m/hns-perl/public_html/diary/board.cgi.in,v > retrieving revision 1.13 > diff -u -r1.13 board.cgi.in > --- board.cgi.in 28 Dec 2002 09:03:49 -0000 1.13 > +++ board.cgi.in 5 Jul 2006 02:39:44 -0000 > @@ -399,6 +399,22 @@ > die 'invalid diary' if ($diary && (!($diary =~ /^[0-9]+$/) || length($diary) > 30)); > die 'invalid refid' if ($refid && (!($refid =~ /^[0-9]+$/) || length($refid) > 10)); > > + my @dirty_words = ''; > + my $spam_list = $HNS::System::DiaryDir . '/conf/spam_list.txt'; > + my @spam_found = (); > + if ( -f $spam_list & -r $spam_list ) { > + open(SPAM, $spam_list) || die 'file not found:$!' ; > + @dirty_words = <SPAM>; > + close(SPAM); > + foreach my $word (@dirty_words) { > + chomp($word); > + push(@spam_found, grep (/$word/, $body)) ; > + push(@spam_found, grep (/$word/, $subject)) ; > + push(@spam_found, grep (/$word/, $site)) ; > + } > + }; > + die 'prohibited' if (@spam_found); > + > foreach ($name, $email, $site) { > die 'included invalid characters' if /\|/; > } // Kenji