Skip to content

Email validation treats emails as valid even if they are not #27875

Closed
@stefanbauer

Description

@stefanbauer
  • Laravel Version: 5.8.4
  • PHP Version: 7.2.7

Description:

Not sure if that is Laravel related, but I guess. If you use the Laravel validator email constraint, it treats an invalid email like something@something as valid. I also tested it with Laravel 5.7. There it works as expected.

I know, that email validation has been updated in 5.8. But as I wrote on Twitter, this kind of validation doesn't make sense anymore then imho, because what does it check at the end? Imho nothing. Other thoughts on that?

Steps To Reproduce:

$validator = Validator::make(['email' => 'something@something'], [
    'email' => 'required|email',
]);

dd($validator->fails()); // returns false, which is not correct
$validator = Validator::make(['email' => 'something'], [
    'email' => 'required|email',
]);

dd($validator->fails()); // returns true, which is correct

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