Skip to content

Commit

Permalink
Validate modifiers
Browse files Browse the repository at this point in the history
Any modifiers that isn't "all" or an integer will be treated as 0.
Allows things like "#chan,stop".

Signed-off-by: knilch <[email protected]>
  • Loading branch information
knilch0r committed Mar 18, 2018
1 parent b761789 commit f755ee0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion telegram.pl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ ($;$)

if ($chan =~ m/^(#.+),(.+)$/) {
$chan = $1;
$chanmod{$chan} = $2;
my $mod = $2;
if (($mod ne 'all') && ($mod =~ /\D/)) {
$mod = 0;
}
$chanmod{$chan} = $mod;
}
my $query = ($chan !~ m/^#/);

Expand Down

0 comments on commit f755ee0

Please sign in to comment.