diff --git a/PBot/BanTracker.pm b/PBot/BanTracker.pm index 9295425c..3da07564 100644 --- a/PBot/BanTracker.pm +++ b/PBot/BanTracker.pm @@ -100,6 +100,7 @@ sub get_baninfo { my ($self, $mask, $channel, $account) = @_; my ($bans, $ban_account); + $account = undef if not length $account; $account = lc $account if defined $account; if ($self->{pbot}->{registry}->get_value('bantracker', 'debug')) { diff --git a/PBot/ChanOpCommands.pm b/PBot/ChanOpCommands.pm index 7ac5a8a0..e64bd7a6 100644 --- a/PBot/ChanOpCommands.pm +++ b/PBot/ChanOpCommands.pm @@ -51,6 +51,9 @@ sub ban_user { my ($from, $nick, $user, $host, $arguments) = @_; my ($target, $channel, $length) = split(/\s+/, $arguments, 3); + $channel = '' if not defined $channel; + $length = '' if not defined $length; + if(not defined $from) { $self->{pbot}->{logger}->log("Command missing ~from parameter!\n"); return ""; @@ -62,7 +65,7 @@ sub ban_user { $channel = $from; } - $channel = $from if not defined $channel; + $channel = $from if not defined $channel or not length $channel; if(not defined $target) { return "/msg $nick Usage: ban [channel [timeout (default: 24 hours)]]";