mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
Factoids: do not encode JSON in expand_action_arguments()
This commit is contained in:
parent
80a4060dab
commit
0977f9aa1e
@ -908,7 +908,7 @@ sub expand_action_arguments {
|
|||||||
if (not defined $input or $input eq '') { %h = (args => $nick); }
|
if (not defined $input or $input eq '') { %h = (args => $nick); }
|
||||||
else { %h = (args => $input); }
|
else { %h = (args => $input); }
|
||||||
|
|
||||||
my $jsonargs = encode_json \%h;
|
my $jsonargs = to_json \%h;
|
||||||
$jsonargs =~ s/^{".*":"//;
|
$jsonargs =~ s/^{".*":"//;
|
||||||
$jsonargs =~ s/"}$//;
|
$jsonargs =~ s/"}$//;
|
||||||
|
|
||||||
@ -986,7 +986,7 @@ sub expand_action_arguments {
|
|||||||
sub escape_json {
|
sub escape_json {
|
||||||
my ($self, $text) = @_;
|
my ($self, $text) = @_;
|
||||||
my $thing = {thing => $text};
|
my $thing = {thing => $text};
|
||||||
my $json = encode_json $thing;
|
my $json = to_json $thing;
|
||||||
$json =~ s/^{".*":"//;
|
$json =~ s/^{".*":"//;
|
||||||
$json =~ s/"}$//;
|
$json =~ s/"}$//;
|
||||||
return $json;
|
return $json;
|
||||||
|
Loading…
Reference in New Issue
Block a user