Roll SLA email targets up to business days, escape priority, validate priority in the tickets API

This commit is contained in:
johnnyq
2026-08-27 15:15:40 -04:00
parent ac175e7dc0
commit 4e1d72e06d
2 changed files with 46 additions and 11 deletions

View File

@@ -27,7 +27,15 @@ if (isset($_POST['ticket_subject'])) {
}
if (isset($_POST['ticket_priority'])) {
// Priority has to be one of the four the rest of the app is built around:
// sla_assignments are keyed on these exact strings, and the ticket list and
// kanban both fall through to the Low styling for anything else, so an
// unrecognised value silently reads as the lowest priority everywhere.
// Anything else is normalised away rather than rejected, matching how this
// model already handles a non-integer client_id.
$allowed_priorities = ['Low', 'Medium', 'High', 'Urgent'];
if (isset($_POST['ticket_priority']) && in_array($_POST['ticket_priority'], $allowed_priorities, true)) {
$priority = escapeSql($_POST['ticket_priority']);
} elseif ($ticket_row) {
$priority = mysqli_real_escape_string($mysqli, $ticket_row['ticket_priority']);