Skip to content

Commit

Permalink
MON-6116: decode JSON fails when not utf8 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
garnier-quentin committed Oct 8, 2020
1 parent 17f8d14 commit defb968
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gorgone/gorgone/modules/centreon/autodiscovery/class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ sub discovery_command_result {

my $result;
eval {
$result = JSON::XS->new->utf8->decode($output);
$result = JSON::XS->new->decode($output);
};

if ($@) {
Expand Down Expand Up @@ -710,7 +710,7 @@ sub discovery_command_result {
my $digest = $ctx->hexdigest;
my $uuid = substr($digest, 0, 8) . '-' . substr($digest, 8, 4) . '-' . substr($digest, 12, 4) . '-' .
substr($digest, 16, 4) . '-' . substr($digest, 20, 12);
my $encoded_host = JSON::XS->new->utf8->encode($host);
my $encoded_host = JSON::XS->new->encode($host);

# Build bulk insert
$values .= $append . "(" . $self->{class_object_centreon}->quote(value => $job_id) . ", " .
Expand Down

0 comments on commit defb968

Please sign in to comment.