Merge branch 'ent-2498-6126-plugin-grep_log-crea-badxml' into 'develop'

Fixed XML inside logs in grep_log plugins

See merge request artica/pandorafms!1657
This commit is contained in:
vgilc 2018-08-03 08:59:51 +02:00
commit ea22ed90e0
1 changed files with 6 additions and 2 deletions

View File

@ -325,7 +325,9 @@ sub print_log ($) {
$output .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
$output .= "<data><![CDATA[";
foreach my $line (@kdata) {
$output .= $data->{$line};
my $processed_line = $line;
$processed_line =~ s/\]\]/]]]]><![CDATA[/g;
$output .= $processed_line;
}
$output .= "]]></data>";
$output .= "</log_module>\n";
@ -343,7 +345,9 @@ sub print_log ($) {
foreach my $line (@kdata) {
$output .= "<data><value><![CDATA[";
foreach my $content (@{$data->{$line}}) {
$output .= $content;
my $processed_line = $content;
$processed_line =~ s/\]\]/]]]]><![CDATA[/g;
$output .= $processed_line;
}
$output .= "]]></value></data>\n";
}