From 3e9f5e82dbe7d556ff612d1c18dab1d9e105677e Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 12 Apr 2026 00:34:15 -0400 Subject: [PATCH] Use styled 404 page for missing/inaccessible tickets Replaces the bare "Ticket not found" text response with the shared views/error_404.php partial so users see the full TDS-styled error page. Also collapsed the two identical 404 branches into one check. Co-Authored-By: Claude Sonnet 4.6 --- controllers/TicketController.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/controllers/TicketController.php b/controllers/TicketController.php index 5172336..1076220 100644 --- a/controllers/TicketController.php +++ b/controllers/TicketController.php @@ -36,16 +36,9 @@ class TicketController { // Get ticket data $ticket = $this->ticketModel->getTicketById($id); - if (!$ticket) { - header("HTTP/1.0 404 Not Found"); - echo "Ticket not found"; - return; - } - - // Check visibility access — return 404 rather than 403 to avoid leaking ticket existence - if (!$this->ticketModel->canUserAccessTicket($ticket, $currentUser)) { - header("HTTP/1.0 404 Not Found"); - echo "Ticket not found"; + if (!$ticket || !$this->ticketModel->canUserAccessTicket($ticket, $currentUser)) { + http_response_code(404); + include dirname(__DIR__) . '/views/error_404.php'; return; }