From 3de97fcd15c7fc82712f943a02e30f2c13faec17 Mon Sep 17 00:00:00 2001 From: Hugo Sampaio Date: Tue, 4 Feb 2025 10:47:23 -0300 Subject: [PATCH] nullable_htmlentities --- tickets_kanban.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tickets_kanban.php b/tickets_kanban.php index 8bb2eea4..058d4c00 100644 --- a/tickets_kanban.php +++ b/tickets_kanban.php @@ -10,7 +10,7 @@ $status_sql = mysqli_query($mysqli, "SELECT * FROM ticket_statuses where ticket_ $statuses = []; while ($status_row = mysqli_fetch_array($status_sql)) { $id = $status_row['ticket_status_id']; - $name = $status_row['ticket_status_name']; + $name = nullable_htmlentities($status_row['ticket_status_name']); $kanban_order = $status_row['ticket_status_order']; $statuses[$id] = new stdClass(); @@ -45,6 +45,13 @@ while ($row = mysqli_fetch_array($sql)) { $ticket_order = $row['ticket_kanban']; $row['ticket_order'] = $ticket_order; // Store the ticket order + // Loop over all items in $row to apply nullable_htmlentities only if the content is a string + foreach ($row as $key => $value) { + if (is_string($value)) { + $row[$key] = nullable_htmlentities($value); + } + } + if (isset($statuses[$id])) { $statuses[$id]->tickets[] = $row; }