-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Description
- Laravel Version: 9.5.1
- PHP Version: 8.1.3
- Database Driver & Version: Not relevant
Description:
Using an empty string as value for the array
rule passes but it should not.
Note: this is an intentional duplicate of #18948, but since that issue has never been solved I decided to open a new one. In that issue there was a discussion about ConvertEmptyStringsToNull
but that's incorrect, since we could use the validation outside of HTTP requests.
Steps To Reproduce:
\Validator::make(['field' => ''], ['field' => 'present|array'])->fails(); // false, WRONG
\Validator::make(['field' => null], ['field' => 'present|array'])->fails(); // true, correct
\Validator::make(['field' => 0], ['field' => 'present|array'])->fails(); // true, correct
\Validator::make(['field' => false], ['field' => 'present|array'])->fails(); // true, correct
Metadata
Metadata
Assignees
Labels
No labels