mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-12 04:52:37 +01:00
Fix apostrophe in expand action arguments, and fix regex
This commit is contained in:
parent
7c19ebbd7b
commit
144c3ec63b
@ -333,6 +333,7 @@ sub find_factoid {
|
|||||||
sub expand_action_arguments {
|
sub expand_action_arguments {
|
||||||
my ($self, $action, $input, $nick) = @_;
|
my ($self, $action, $input, $nick) = @_;
|
||||||
|
|
||||||
|
$input =~ s/'/\\'/g;
|
||||||
my @args = shellwords($input);
|
my @args = shellwords($input);
|
||||||
|
|
||||||
if (not defined $input or $input eq '') {
|
if (not defined $input or $input eq '') {
|
||||||
@ -521,7 +522,7 @@ sub interpreter {
|
|||||||
$action = $self->expand_action_arguments($action, $arguments, defined $tonick ? $tonick : $nick);
|
$action = $self->expand_action_arguments($action, $arguments, defined $tonick ? $tonick : $nick);
|
||||||
$arguments = "";
|
$arguments = "";
|
||||||
} else {
|
} else {
|
||||||
if($action !~ /^\/.+? /) {
|
if($action !~ /^\/.+? / and $self->{factoids}->hash->{$channel}->{$keyword}->{type} eq 'text') {
|
||||||
if ($self->{pbot}->{nicklist}->is_present($from, $arguments)) {
|
if ($self->{pbot}->{nicklist}->is_present($from, $arguments)) {
|
||||||
$action =~ s/^/\/say $arguments: $keyword is / unless defined $tonick;
|
$action =~ s/^/\/say $arguments: $keyword is / unless defined $tonick;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user