3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Fix adminset not working on hostmasks with anchors

This commit is contained in:
Pragmatic Software 2017-11-22 15:25:14 -08:00
parent a1217190c7
commit 834cfaa11d

View File

@ -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;
}
}
}