2014-04-27 Junichi Satoh <junichi@rworks.jp>

* lib/PandoraFMS/PluginServer.pm: Fixed plugin execution failure
	when multibyte characters are used in plugins macros.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9821 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2014-04-27 03:42:38 +00:00
parent 73e40e8c00
commit e967fe3baf
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-04-27 Junichi Satoh <junichi@rworks.jp>
* lib/PandoraFMS/PluginServer.pm: Fixed plugin execution failure
when multibyte characters are used in plugins macros.
2014-04-24 Vanessa Gil <vanessa.gil@artica.es> 2014-04-24 Vanessa Gil <vanessa.gil@artica.es>
* lib/PandoraFMS/Core.pm: Removed entities * lib/PandoraFMS/Core.pm: Removed entities

View File

@ -27,6 +27,7 @@ use Thread::Semaphore;
use POSIX qw(strftime); use POSIX qw(strftime);
use HTML::Entities; use HTML::Entities;
use JSON qw(decode_json); use JSON qw(decode_json);
use Encode qw(encode_utf8);
# Default lib dir for RPM and DEB packages # Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5'; use lib '/usr/lib/perl5';
@ -177,7 +178,7 @@ sub data_consumer ($$) {
eval { eval {
if ($module->{'macros'} ne '') { if ($module->{'macros'} ne '') {
logger ($pa_config, "Decoding json macros from # $module_id plugin command '$command'", 10); 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}; my %macros = %{$macros};
if(ref($macros) eq "HASH") { if(ref($macros) eq "HASH") {
foreach my $macro_id (keys(%macros)) foreach my $macro_id (keys(%macros))