From 63c4b5ec6b0b019b8e75ceb5dfb84d5cbc901a69 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 28 May 2019 15:40:51 +0200 Subject: [PATCH] Ref #1524 --- centreon-plugins/apps/voip/3cx/restapi/custom/api.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/centreon-plugins/apps/voip/3cx/restapi/custom/api.pm b/centreon-plugins/apps/voip/3cx/restapi/custom/api.pm index b7e61acdb..af5642fa8 100644 --- a/centreon-plugins/apps/voip/3cx/restapi/custom/api.pm +++ b/centreon-plugins/apps/voip/3cx/restapi/custom/api.pm @@ -195,9 +195,8 @@ sub request_api { ); # Some content may be strangely returned, for example : "[{\"Category\":\"provider\",\"Count\":1}]" - if ($content =~ /^"(\[.*\])"$/) { - $content = $1; - $content =~ s/\\"/"/g; + if (defined($options{eval_content}) && $options{eval_content} == 1) { + $content = eval "$content"; } my $decoded; @@ -249,7 +248,7 @@ sub api_system_status { sub internal_update_checker { my ($self, %options) = @_; - my $status = $self->request_api(method => 'GET', url_path =>'/api/UpdateChecker/GetFromParams'); + my $status = $self->request_api(method => 'GET', url_path =>'/api/UpdateChecker/GetFromParams', eval_content => 1); return $status; }