Skip to content

Commit

Permalink
Merge pull request #4108 from Roardom/fix-system-with-trashed
Browse files Browse the repository at this point in the history
(Fix) Prevent users from replying to deleted system user
  • Loading branch information
HDVinnie authored Aug 28, 2024
2 parents e3aa4ad + 666361a commit c8ea7ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/User/ConversationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function update(UpdateConversationRequest $request, User $user, Conversat
{
abort_unless($request->user()->is($user), 403);

abort_if($conversation->participants()->where('user_id', '=', User::SYSTEM_USER_ID)->exists(), 403, 'You cannot reply to the system');
abort_if($conversation->participants()->withTrashed()->where('user_id', '=', User::SYSTEM_USER_ID)->exists(), 403, 'You cannot reply to the system');

PrivateMessage::create([
'sender_id' => $user->id,
Expand Down

0 comments on commit c8ea7ee

Please sign in to comment.