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:
@@ -131,7 +131,7 @@ class AttachmentModel {
|
||||
}
|
||||
|
||||
$attachment = $this->getAttachment($attachmentId);
|
||||
return $attachment && $attachment['uploaded_by'] == $userId;
|
||||
return $attachment && (int)$attachment['uploaded_by'] === (int)$userId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user