Skip to content

Commit

Permalink
fix: prevent users from replying to deleted system user
Browse files Browse the repository at this point in the history
  • Loading branch information
Roardom committed Aug 28, 2024
1 parent f3c21c8 commit 666361a
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 666361a

Please sign in to comment.