Fix loose comparisons in authorization checks
- TicketModel.php: fix bind_param "sssi"→"issi" for ticketId in addComment() - TicketModel.php: use strict (int) cast === for confidential ticket access check - update_ticket.php: use strict (int) cast !== for creator/assignee auth check - AttachmentModel.php: use strict (int) cast === for upload ownership check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,8 +92,8 @@ try {
|
||||
|
||||
// Authorization: admins can edit any ticket; others only their own or assigned
|
||||
if (!$this->isAdmin
|
||||
&& $currentTicket['created_by'] != $this->userId
|
||||
&& $currentTicket['assigned_to'] != $this->userId
|
||||
&& (int)$currentTicket['created_by'] !== (int)$this->userId
|
||||
&& (int)$currentTicket['assigned_to'] !== (int)$this->userId
|
||||
) {
|
||||
return [
|
||||
'success' => false,
|
||||
|
||||
Reference in New Issue
Block a user