Skip to content

Commit

Permalink
[5.2] Cast unique validation exclude id to integer (#14076)
Browse files Browse the repository at this point in the history
* Cast unique validation exclude id to integer

* Fix StyleCI
  • Loading branch information
sakalauskas authored and taylorotwell committed Jun 20, 2016
1 parent 838a5bd commit a94a83c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,10 @@ protected function validateUnique($attribute, $value, $parameters)
if (strtolower($id) == 'null') {
$id = null;
}

if (filter_var($id, FILTER_VALIDATE_INT) !== false) {
$id = intval($id);
}
}

// The presence verifier is responsible for counting rows within this store
Expand Down

0 comments on commit a94a83c

Please sign in to comment.