Skip to content

Empty string passes 'array' validation rule #18948

@refi93

Description

@refi93
  • Laravel Version: 5.4.6
  • PHP Version: 7.1.2

Description:

The validation rule for an array allows for an empty string which seems weird to me, see the following example:

Steps To Reproduce:

$ php artisan tinker
>>> (\Validator::make( ['field' => ""], ['field' => 'array'] ))->passes();
=> true

Tested with:

$ php artisan --version
Laravel Framework Lumen (5.4.6) (Laravel Components 5.4.*)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions