From eaf10f7d6ec52a72fa410fd7dff42548e1cf7f9e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 30 Apr 2020 18:07:52 +0200 Subject: [PATCH] weird json --- pandora_server/lib/PandoraFMS/Tools.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 4b1486f0ef..c95324e79d 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -2390,12 +2390,12 @@ sub p_encode_json { ################################################################################ sub p_decode_json { my ($pa_config, $data) = @_; - - # Initialize JSON manager. - my $json = JSON->new->allow_nonref; my $decoded_data; if ($JSON::VERSION > 2.90) { + # Initialize JSON manager. + my $json = JSON->new->allow_nonref; + $decoded_data = $json->decode($data); } else { if (!is_empty($decoded_data)) {