From 9dbd84f6c50a19ed7d4f1754d695f30e5433d1a4 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 3 Jan 2020 23:04:46 -0800 Subject: [PATCH] Commands: use boundary when extracting admin channel from arguments --- PBot/Commands.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBot/Commands.pm b/PBot/Commands.pm index 965b2457..230a1e98 100644 --- a/PBot/Commands.pm +++ b/PBot/Commands.pm @@ -100,7 +100,7 @@ sub interpreter { } my $from = exists $stuff->{admin_channel_override} ? $stuff->{admin_channel_override} : $stuff->{from}; - my ($admin_channel) = $stuff->{arguments} =~ m/(#[^ ]+)/; # assume first channel-like argument + my ($admin_channel) = $stuff->{arguments} =~ m/\B(#[^ ]+)/; # assume first channel-like argument $admin_channel = $from if not defined $admin_channel; my $admin = $self->{pbot}->{admins}->loggedin($admin_channel, "$stuff->{nick}!$stuff->{user}\@$stuff->{host}"); my $level = defined $admin ? $admin->{level} : 0;