3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

BotAdmins: anchor hostmask regex in find_admin()

This commit is contained in:
Pragmatic Software 2019-12-30 15:47:23 -08:00
parent 2a437b479e
commit c230a2f3b3

View File

@ -153,7 +153,7 @@ sub find_admin {
foreach my $channel_regex (keys %{ $self->{admins}->hash }) {
if ($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 or $hostmask eq lc $hostmask_regex;
return $self->{admins}->hash->{$channel_regex}->{$hostmask_regex} if $hostmask =~ m/^$hostmask_regex$/i or $hostmask eq lc $hostmask_regex;
}
}
}