mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 03:33:06 +01:00
BanList: ensure !ban/!mute mask is wildcard-complete when appropriate
This commit is contained in:
parent
c952a84d82
commit
a412c98ea9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user