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

BanList: ensure !ban/!mute mask is wildcard-complete when appropriate

This commit is contained in:
Pragmatic Software 2020-06-13 13:22:44 -07:00
parent c952a84d82
commit a412c98ea9

View File

@ -524,12 +524,16 @@ sub nick_to_banmask {
}
}
if ($mask !~ /!/) {
$mask .= '!*@*';
} elsif ($mask !~ /@/) {
$mask =~ s/\*?$/*@*/;
} else {
$mask =~ s/\@$/@*/;
# make sure $mask always has full wildcards
# there's probably a better way to do this...
if ($mask !~ /^\$/) {
if ($mask !~ /!/) {
$mask .= '!*@*';
} elsif ($mask !~ /@/) {
$mask =~ s/\*?$/*@*/;
} else {
$mask =~ s/\@$/@*/;
}
}
return $mask;