From dd78326a4cd9ec0cd4d9b271625a0b8406f9adb5 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 18 Jun 2019 13:38:22 +0200 Subject: [PATCH 1/3] Remove entities from json reports --- pandora_console/include/functions_reporting.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index eb215340c3..df4c60c05d 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -151,11 +151,13 @@ function reporting_make_reporting_data( $contents = $report['contents']; } else { $report = io_safe_output(db_get_row('treport', 'id_report', $id_report)); - $contents = db_get_all_rows_field_filter( - 'treport_content', - 'id_report', - $id_report, - db_escape_key_identifier('order') + $contents = io_safe_output( + db_get_all_rows_field_filter( + 'treport_content', + 'id_report', + $id_report, + db_escape_key_identifier('order') + ) ); } @@ -6073,7 +6075,7 @@ function reporting_advanced_sla( // SLA. $return['SLA'] = reporting_sla_get_compliance_from_array($return); - $return['SLA_fixed'] = sla_truncate( + $return['sla_fixed'] = sla_truncate( $return['SLA'], $config['graph_precision'] ); From d39be510cfd029234b8cd4d4de0cae66ce1a4624 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Tue, 18 Jun 2019 14:03:51 +0200 Subject: [PATCH 2/3] Remove entitites to availability reports --- .../include/functions_reporting.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index df4c60c05d..ff3b9cd08d 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -344,10 +344,12 @@ function reporting_make_reporting_data( break; case 'availability_graph': - $report['contents'][] = reporting_availability_graph( - $report, - $content, - $pdf + $report['contents'][] = io_safe_output( + reporting_availability_graph( + $report, + $content, + $pdf + ) ); break; @@ -6398,10 +6400,12 @@ function reporting_availability_graph($report, $content, $pdf=false) $edge_interval = 10; if (empty($content['subitems'])) { - $slas = db_get_all_rows_field_filter( - 'treport_content_sla_combined', - 'id_report_content', - $content['id_rc'] + $slas = io_safe_output( + db_get_all_rows_field_filter( + 'treport_content_sla_combined', + 'id_report_content', + $content['id_rc'] + ) ); } else { $slas = $content['subitems']; From 174db17a05091250e6d5cee4f4416dfb0703aefd Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Wed, 19 Jun 2019 12:33:11 +0200 Subject: [PATCH 3/3] remove entities from reports --- .../include/functions_reporting.php | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index ff3b9cd08d..9a5f8bae7c 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -328,18 +328,22 @@ function reporting_make_reporting_data( break; case 'general': - $report['contents'][] = reporting_general( - $report, - $content + $report['contents'][] = io_safe_output( + reporting_general( + $report, + $content + ) ); break; case 'availability': - $report['contents'][] = reporting_availability( - $report, - $content, - $date, - $time + $report['contents'][] = io_safe_output( + reporting_availability( + $report, + $content, + $date, + $time + ) ); break; @@ -479,9 +483,11 @@ function reporting_make_reporting_data( break; case 'agent_configuration': - $report['contents'][] = reporting_agent_configuration( - $report, - $content + $report['contents'][] = io_safe_output( + reporting_agent_configuration( + $report, + $content + ) ); break; @@ -677,12 +683,14 @@ function reporting_make_reporting_data( case 'agent_detailed_event': case 'event_report_agent': - $report_control = reporting_event_report_agent( - $report, - $content, - $type, - $force_width_chart, - $force_height_chart + $report_control = io_safe_output( + reporting_event_report_agent( + $report, + $content, + $type, + $force_width_chart, + $force_height_chart + ) ); if ($report_control['total_events'] == 0 && $content['hide_no_data'] == 1) { continue; @@ -2180,7 +2188,7 @@ function reporting_agent_module($report, $content) foreach ($agents as $agent) { $row = []; $row['agent_status'][$agent] = agents_get_status($agent); - $row['agent_name'] = agents_get_alias($agent); + $row['agent_name'] = io_safe_output(agents_get_alias($agent)); $agent_modules = agents_get_modules($agent); $row['modules'] = []; @@ -2781,7 +2789,7 @@ function reporting_event_report_agent( } $return['title'] = $content['name']; - $return['subtitle'] = agents_get_alias($content['id_agent']); + $return['subtitle'] = io_safe_output(agents_get_alias($content['id_agent'])); $return['description'] = $content['description']; $return['date'] = reporting_get_date_text($report, $content);