From 164258d02a7cde163ae655e1c7dfb99f66e41042 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Sun, 2 May 2021 19:07:50 -0400 Subject: [PATCH] Use latest guestbook --- cgi-bin/guest_mm.cgi | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cgi-bin/guest_mm.cgi b/cgi-bin/guest_mm.cgi index cdf9d42..640f925 100755 --- a/cgi-bin/guest_mm.cgi +++ b/cgi-bin/guest_mm.cgi @@ -134,20 +134,28 @@ sub params_in { } # Variable set for banned user - my $ban; + my ($ban, $trigger); # Parse the banned names list chomp(my @nameBan = <$nameBans>); for (@nameBan) { - last if $ban; - $ban = 1 if $name =~ /$_/; + last if $ban; + + if ($name =~ /$_/i) { + $ban = 1; + $trigger = $_; + } } # Parse the banned phrases list chomp(my @thoughtCrime = <$thoughtCrimes>); for (@thoughtCrime) { - last if $ban; - $ban = 1 if $message =~ /$_/; + last if $ban; + + if ($message =~ /$_/i) { + $ban = 1; + $trigger = $_; + } } # Send it unless ban is true; else send it to spam if spam chan is @@ -159,11 +167,13 @@ sub params_in { message => "$name from $location says: $message" } ); - } elsif ($spam) { + } + elsif ($spam) { $resource->create( { channel_id => "$spam", - message => "$name from $location says: $message" + message => "$name from $location says: $message\n\n" . + "Spam trigger: `$trigger`" } ); }