Skip to content
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

[BUG] email Validation allows spaces #45646

Closed
jLynx opened this issue Jan 13, 2023 · 2 comments
Closed

[BUG] email Validation allows spaces #45646

jLynx opened this issue Jan 13, 2023 · 2 comments

Comments

@jLynx
Copy link

jLynx commented Jan 13, 2023

  • Laravel Version: 9.46.0
  • PHP Version: 8.2.0

Description:

When using the email validation (https://laravel.com/docs/5.2/validation#rule-email), it allows white spaces which it should not allow as that is not a valid email address.

Steps To Reproduce:

$request->validate([
            'email' => 'required|email|max:255|unique:user|confirmed',
        ]);

This currently will pass and be valid if you enter in the address test @example.com when in fact it should fail as it contains a space between test and @.

@jLynx
Copy link
Author

jLynx commented Jan 13, 2023

As mentioned in here, it can be fixed by using email:strict. I think this should be included in the documentation here https://laravel.com/docs/5.2/validation#rule-email. So for that reason I will keep this issue open for now.

@jLynx
Copy link
Author

jLynx commented Jan 13, 2023

Closing this as I was looking at the wrong documentation, I was looking at 5.2 instead of 9. Its correctly listed here https://laravel.com/docs/9.x/validation#rule-email

@jLynx jLynx closed this as completed Jan 13, 2023
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

1 participant