-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Email validation allows spaces #28233
Comments
Laravel makes use of https://github.com/egulias/EmailValidator/ to do email validation so if you feel that this is a bug please open up an issue on their issue tracker: https://github.com/egulias/EmailValidator/issues |
I don't "feel" this is a bug; this is a bug. Emails aren't allowed to have spaces. Why package wasn't checked and/or tested before it was included into framework? |
According to the official spec, the local part of an email is allowed to have spaces. The domain should not though. |
Why is this package even used for email validation? Because, after we tested some strings, we get these results: This package only fails when there are more than 1 "@" symbol, quotes or space between dot and tld. Why is this package considered "better" approach than default PHP filter_var function or even some other package? Also, this bug with spaces is since 2014. |
Looks like this package is validating emails with spaces in the domain part. (new EmailValidator)->isValid('dwight@ gmail.com', new RFCValidation) // true This was problem was discussed further in #27875 but doesn't look like there's going to be any change here. The package was introduced in #26503 so I suppose the other option is to break out your own custom email validation rule and use it in place. |
It is not. |
Please reopen this issue as the bug still exists and even affects the out-of-the-box registration flow. I suggest making filter_var the default email validator. |
hi there, as this problem still exists, i would be happy to know the optimal way to validate an email address in laravel, because using |
03:13 AM, September 30th, 2022. This problem still exists and it nearly ruined my project! Come on guys do something! |
@dammixyz for now, i am good with |
Thank you for the heads up.
…On Fri, Sep 30, 2022, 11:29 AM Micha(el) Bladowski ***@***.***> wrote:
@dammixyz <https://github.com/dammixyz> for now, i am good with
'required|email:strict,dns|not_regex:/[ÄäÜüÖö]/'
—
Reply to this email directly, view it on GitHub
<#28233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALSECDMWZEM7OOSF3PRMRO3WA26ILANCNFSM4HGJFJQQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This should be the default :D |
Description:
Email validation doesn't fail when email contains spaces:
"test @ example .com", but fails here "test@example. com".
This seems as big bug to me.
Steps To Reproduce:
Tinker:
The text was updated successfully, but these errors were encountered: