Replace Function nullable_htmlentities() with just escapeHtml() and update all instances throughout

This commit is contained in:
johnnyq
2026-07-14 17:10:45 -04:00
parent d62b6e2ae7
commit 7bc47a58fe
338 changed files with 3057 additions and 3057 deletions

View File

@@ -66,7 +66,7 @@ function getTicketStatusName($ticket_status) {
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT * FROM ticket_statuses WHERE ticket_status_id = $status_id LIMIT 1"));
if ($row) {
return nullable_htmlentities($row['ticket_status_name']);
return escapeHtml($row['ticket_status_name']);
}
// Default return
@@ -175,7 +175,7 @@ function display_folder_options($parent_folder_id, $client_id, $indent = 0) {
$sql_folders = mysqli_query($mysqli, "SELECT * FROM folders WHERE parent_folder = $parent_folder_id AND folder_client_id = $client_id ORDER BY folder_name ASC");
while ($row = mysqli_fetch_assoc($sql_folders)) {
$folder_id = intval($row['folder_id']);
$folder_name = nullable_htmlentities($row['folder_name']);
$folder_name = escapeHtml($row['folder_name']);
// Indentation for subfolders
$indentation = str_repeat(' ', $indent * 4);

View File

@@ -4,7 +4,7 @@
// Split from the former monolithic functions.php
function nullable_htmlentities($unsanitizedInput) {
function escapeHtml($unsanitizedInput) {
//return htmlentities($unsanitizedInput ?? '');
return htmlspecialchars($unsanitizedInput ?? '', ENT_QUOTES, 'UTF-8');
}