From 4e041f94fa0d4bc11eef4fbb3c85c3c08e99d14e Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 12 May 2018 02:51:23 -0700 Subject: [PATCH] Anchor blacklist regexes --- PBot/BlackList.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PBot/BlackList.pm b/PBot/BlackList.pm index 2732e3b3..40ff8b46 100644 --- a/PBot/BlackList.pm +++ b/PBot/BlackList.pm @@ -154,13 +154,13 @@ sub check_blacklist { next if $channel !~ /^$black_channel_escaped$/; - if ($flag eq 'a' && defined $nickserv && $nickserv =~ /$black_hostmask_escaped/i) { + if ($flag eq 'a' && defined $nickserv && $nickserv =~ /^$black_hostmask_escaped$/i) { $self->{pbot}->{logger}->log("$hostmask nickserv $nickserv blacklisted in channel $channel (matches [\$a:$black_hostmask] host and [$black_channel] channel)\n"); return 1; - } elsif ($flag eq 'r' && defined $gecos && $gecos =~ /$black_hostmask_escaped/i) { + } elsif ($flag eq 'r' && defined $gecos && $gecos =~ /^$black_hostmask_escaped$/i) { $self->{pbot}->{logger}->log("$hostmask GECOS $gecos blacklisted in channel $channel (matches [\$r:$black_hostmask] host and [$black_channel] channel)\n"); return 1; - } elsif ($flag eq '' && $hostmask =~ /$black_hostmask_escaped/i) { + } elsif ($flag eq '' && $hostmask =~ /^$black_hostmask_escaped$/i) { $self->{pbot}->{logger}->log("$hostmask blacklisted in channel $channel (matches [$black_hostmask] host and [$black_channel] channel)\n"); return 1; }