From 8c8601903789ce462b65ae86539876f904ef3fcc Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 18 Mar 2020 12:25:29 +0100 Subject: [PATCH] Ent 5583 bug comando de alerta --- .../godmode/alerts/alert_commands.php | 26 ++++++++++++++++--- .../godmode/alerts/configure_alert_action.php | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 7fa2b9a3f0..3650c206ab 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -56,7 +56,19 @@ if (is_ajax()) { // If is setted a description, we change the carriage return by
tags if (isset($command['description'])) { - $command['description'] = io_safe_input(str_replace("\r\n", '
', io_safe_output($command['description']))); + $command['description'] = str_replace( + [ + '<', + '>', + "\r\n", + ], + [ + '', + '', + '
', + ], + io_safe_output($command['description']) + ); } // Descriptions are stored in json. @@ -431,8 +443,16 @@ foreach ($commands as $command) { $data['id'] = $command['id']; $data['group'] = ui_print_group_icon($command['id_group'], true); $data['description'] = str_replace( - "\r\n", - '
', + [ + '<', + '>', + "\r\n", + ], + [ + '', + '', + '
', + ], io_safe_output($command['description']) ); $data['action'] = ''; diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 60052e9645..4f3011649b 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -305,7 +305,7 @@ $(document).ready (function () { var origicommand_descriptionnal_command; if () { - original_command = ""; + original_command = "', addslashes(io_safe_output(alerts_get_alert_command_command($id_command)))); ?>"; render_command_preview(original_command); command_description = "', addslashes(io_safe_output(alerts_get_alert_command_description($id_command)))); ?>";