Skip to content

The Email validation is not working correct !!! #28316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TiBianMod opened this issue Apr 23, 2019 · 4 comments
Closed

The Email validation is not working correct !!! #28316

TiBianMod opened this issue Apr 23, 2019 · 4 comments

Comments

@TiBianMod
Copy link

  • Laravel Version: 5.8.14
  • PHP Version: 7.3.4
  • Database Driver & Version: No need

Description:

In previous versions of Laravel, I remember only emails like name@domain.com will pass the Validation.
Now emails like name@domain are valid ?

Steps To Reproduce:

Route::get('/', function () {

    $request = [
        'field' => 'n@d', // invalid email address
    ];

    $validator = Validator::make($request, [
        'field' => 'email',
    ]);
     
    if ($validator->fails()) {
        // We need to reach this point and the validation need to fail.
        dd('VALIDATION FAILS');
    }


    // Unfortunately the validation passes :(
    return 'VALIDATION PASSES';
});
@robert-moore96
Copy link

That is a valid email

@driesvints
Copy link
Member

This is a valid email address. Please see #28233, #27875 and other issues.

@TiBianMod
Copy link
Author

OK. I see.
One email address don't need to have a TLD to be valid... new stuff.

@kaythinks
Copy link

For those still having issues with this, use this 'email' => 'email:filter' which uses the filter_var() method under the hood to check if the email is valid. Refer to https://laravel.com/docs/5.8/validation#rule-email for other email validation types .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants