From 834cfaa11dc43772f3f601bdcb6c0fe3551cab94 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 22 Nov 2017 15:25:14 -0800 Subject: [PATCH] Fix `adminset` not working on hostmasks with anchors --- PBot/BotAdmins.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PBot/BotAdmins.pm b/PBot/BotAdmins.pm index cfa776cc..6fdc380a 100644 --- a/PBot/BotAdmins.pm +++ b/PBot/BotAdmins.pm @@ -145,6 +145,7 @@ sub find_admin { $from = $self->{pbot}->{registry}->get_value('irc', 'botnick') if not defined $from; $hostmask = '.*' if not defined $hostmask; + $hostmask = lc $hostmask; my $result = eval { foreach my $channel_regex (keys %{ $self->{admins}->hash }) { @@ -154,7 +155,7 @@ sub find_admin { } } elsif($from =~ m/^$channel_regex$/i) { foreach my $hostmask_regex (keys %{ $self->{admins}->hash->{$channel_regex} }) { - return $self->{admins}->hash->{$channel_regex}->{$hostmask_regex} if $hostmask =~ m/$hostmask_regex/i; + return $self->{admins}->hash->{$channel_regex}->{$hostmask_regex} if $hostmask =~ m/$hostmask_regex/i or $hostmask eq lc $hostmask_regex; } } }