Merge branch 'ent-8766-POST-Error-al-crear-eventos-con-comentarios-que-tienen-salto-de-línea' into 'develop'

Ent 8766 post error al crear eventos con comentarios que tienen salto de línea

See merge request artica/pandorafms!4796
This commit is contained in:
Daniel Rodriguez 2022-06-02 07:33:10 +00:00
commit 98dd5b81ce
2 changed files with 4 additions and 1 deletions

View File

@ -136,7 +136,7 @@ if ($get_comments === true) {
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s" AND `estado` = "%s"',
io_safe_output($event['evento']),
$event['evento'],
$event['estado']
);
// If id_agente is reported, filter the messages by them as well.

View File

@ -2297,6 +2297,7 @@ function events_comment(
$comments_format = 'new';
} else {
// If comments are not stored in json, the format is old.
$event_comments[0]['user_comment'] = str_replace(["\n", '&#x0a;'], '<br>', $event_comments[0]['user_comment']);
$event_comments_array = json_decode($event_comments[0]['user_comment']);
if (empty($event_comments_array) === true) {
@ -5227,6 +5228,8 @@ function events_page_comments($event, $ajax=false, $groupedComments=[])
$comm = $comm['user_comment'];
}
$comm = str_replace(["\n", '&#x0a;'], '<br>', $comm);
$comments_array[] = io_safe_output(json_decode($comm, true));
}