-
Notifications
You must be signed in to change notification settings - Fork 2.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
Change e-mail validation regex to accept subdomains with hyphens. #32240
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32240 +/- ##
============================================
+ Coverage 64.01% 64.01% +<.01%
Complexity 18559 18559
============================================
Files 1171 1171
Lines 69834 69834
Branches 1267 1267
============================================
+ Hits 44704 44706 +2
+ Misses 24761 24758 -3
- Partials 369 370 +1
Continue to review full report at Codecov.
|
would this work? |
@felixboehm If you accidently put two dots in the address, it will fail verification. |
@PVince81 after conversation in the chat, we need your feedback on this. |
I'd be happy to see a unit test covering the various samples of email addresses passing the regex. |
d51eeaf
to
83b576d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
squash commits please
8a591fa
to
21100e1
Compare
ok, i accidently committed the wrong file |
complete mess :-( |
21100e1
to
68e2810
Compare
sorry for the noise... |
68e2810
to
5ef7bee
Compare
Add tests, change regex to fail on umlauts.
5ef7bee
to
6585610
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@micbar please backport to stable10 |
Backport |
Description
The filter regex which helps to validate the entered e-mail addresses does not accept subdomains with hyphens.
Steps to reproduce
Expected behaviour
E-Mail address is being added to the field
Actual behaviour
Some E-Mail addresses with "-" charakter in the second subdomain get rejected / could not be added.
Examples - working
Examples - not working
Related Issue
Motivation and Context
This has been discovered by a customer whose domains all contain a second subdomain with a hyphen
How Has This Been Tested?
New Regex, proposed solution
^[A-Za-z0-9\._%+-]+@(?:[A-Za-z0-9-]+\.)+[a-z]{2,}$
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: