diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index f8b741e85b..9b3eb339c9 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2014-04-27 Junichi Satoh + + * lib/PandoraFMS/PluginServer.pm: Fixed plugin execution failure + when multibyte characters are used in plugins macros. + 2014-04-24 Vanessa Gil * lib/PandoraFMS/Core.pm: Removed entities diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index d20f79b44c..8864f6c17f 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -27,6 +27,7 @@ use Thread::Semaphore; use POSIX qw(strftime); use HTML::Entities; use JSON qw(decode_json); +use Encode qw(encode_utf8); # Default lib dir for RPM and DEB packages use lib '/usr/lib/perl5'; @@ -177,7 +178,7 @@ sub data_consumer ($$) { eval { if ($module->{'macros'} ne '') { logger ($pa_config, "Decoding json macros from # $module_id plugin command '$command'", 10); - my $macros = decode_json($module->{'macros'}); + my $macros = decode_json(encode_utf8($module->{'macros'})); my %macros = %{$macros}; if(ref($macros) eq "HASH") { foreach my $macro_id (keys(%macros))