mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01:00
Factoids: correct edge-case mishandling of quoted arguments
This commit is contained in:
parent
8a664a3ea1
commit
f00cabe4ec
@ -614,8 +614,7 @@ sub factunset {
|
||||
my ($channel, $trigger, $arguments) = $self->find_factoid_with_optional_channel($from, $args, 'factunset', $usage, 1);
|
||||
return $channel if not defined $trigger; # if $trigger is not defined, $channel is an error message
|
||||
|
||||
my $arglist = $self->{pbot}->{interpreter}->make_args($arguments);
|
||||
my ($key) = $self->{pbot}->{interpreter}->split_args($arglist, 1);
|
||||
my ($key) = $self->{pbot}->{interpreter}->split_line($arguments, 1);
|
||||
|
||||
return $usage if not length $key;
|
||||
|
||||
|
@ -313,7 +313,9 @@ sub find_factoid {
|
||||
} else {
|
||||
$command = $1;
|
||||
}
|
||||
($keyword, $arguments) = split /\s+/, $command, 2;
|
||||
my @args = $self->{pbot}->{interpreter}->split_line($command, 1);
|
||||
$keyword = shift @args;
|
||||
$arguments = join ' ', @args;
|
||||
goto NEXT_DEPTH;
|
||||
}
|
||||
|
||||
@ -341,7 +343,9 @@ sub find_factoid {
|
||||
|
||||
if ($find_alias) {
|
||||
my $command = $self->{factoids}->hash->{$channel}->{$trigger}->{action};
|
||||
($keyword, $arguments) = split /\s+/, $command, 2;
|
||||
my @args = $self->{pbot}->{interpreter}->split_line($command, 1);
|
||||
$keyword = shift @args;
|
||||
$arguments = join ' ', @args;
|
||||
$string = $keyword . (length $arguments ? " $arguments" : "");
|
||||
goto NEXT_DEPTH;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user