From 5148dcdaefdaccc2c18652af5cbed679285e8db9 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 9 Mar 2023 17:17:54 +0100 Subject: [PATCH] fixes in event comments --- pandora_console/include/ajax/events.php | 7 +++---- pandora_console/include/functions_events.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index ccdb086f9a..d7b0fe4c47 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -91,9 +91,8 @@ $node_id = (int) get_parameter('node_id', 0); if ($get_comments === true) { $event = get_parameter('event', false); - $event_rep = (int) get_parameter('event_rep', 0); - $event_rep = get_parameter_post('event')['event_rep']; - $group_rep = get_parameter_post('event')['group_rep']; + $event_rep = (int) get_parameter_post('event')['event_rep']; + $group_rep = (int) get_parameter_post('event')['group_rep']; if ($event === false) { return __('Failed to retrieve comments'); @@ -126,7 +125,7 @@ if ($get_comments === true) { } else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) { $whereGrouped = sprintf( '`id_extra` = "%s"', - $event['id_extra'] + io_safe_output($event['id_extra']) ); } else { $whereGrouped = sprintf('`id_evento` = %d', $event['id_evento']); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index f779b7121e..7ef77e6e47 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5172,7 +5172,7 @@ function events_page_comments($event, $ajax=false, $groupedComments=[]) __('Add comment'), 'comment_button', false, - 'event_comment(\''.base64_encode(json_encode($event)).'\');', + 'event_comment("'.base64_encode(json_encode($event)).'");', [ 'icon' => 'next', 'mode' => 'mini secondary',