Skip to content

Commit

Permalink
fix(validation): invalidate unnatural IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Jun 7, 2024
1 parent 57a5757 commit 3529c4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Validation/DatabaseRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function ensure_ownership(
$current_user = auth()->user();
$search_mode = $parameters[1];

if (!$model->isOwnedBy($current_user, $search_mode, intval($id))) {
if (intval($id) <= 0 || !$model->isOwnedBy($current_user, $search_mode, intval($id))) {
return false;
}

Expand Down

0 comments on commit 3529c4f

Please sign in to comment.