weird json

This commit is contained in:
fbsanchez 2020-04-30 18:11:50 +02:00
parent eaf10f7d6e
commit 55392bac47

View File

@ -2391,17 +2391,14 @@ sub p_encode_json {
sub p_decode_json { sub p_decode_json {
my ($pa_config, $data) = @_; my ($pa_config, $data) = @_;
my $decoded_data; my $decoded_data;
if ($JSON::VERSION > 2.90) { if ($JSON::VERSION > 2.90) {
# Initialize JSON manager. # Initialize JSON manager.
my $json = JSON->new->allow_nonref; my $json = JSON->new->allow_nonref;
$decoded_data = $json->decode($data);
$decoded_data = $json->decode($data); } else {
} else { $decoded_data = decode_json($data);
if (!is_empty($decoded_data)) { }
$decoded_data = decode_json($data);
}
}
return $decoded_data; return $decoded_data;
} }