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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user