Email address validation expression fails some valid emails that use Plus Addressing
Description
Attempting to enter an email address that uses Plus Addressing fails if the address uses a period after the plus.
Actual Behavior
[email protected] will fail (often silently) even though it is a valid address consistent with email address conventions. [email protected] (omitting the . between john and doe) will succeed.
Expected Behavior
Valid email addresses utilizing Plus Addressing should be supported.
Steps to Reproduce
-
Go to rocksolidchurchdemo.com, log in.
-
People -> Prayer -> Add Prayer Request
-
Add a prayer request with an email address like
[email protected] -
Click Save. You will not see an error, but the form will not save.
-
Remove the
.betweenjohnanddoe. -
Click Save. This time, the prayer request will save.
One fix is to replace this regular expression: [\w\.\'_%-]+(\+[\w-]*)?@([\w-]+\.)+[\w-]+
with this regular expression: [\w\.\'_%-]+(\+[\w\.\'_%-]*)?@([\w-]+\.)+[\w-]+
I found this expression used three different places in the codebase.
Issue Confirmation
- [X] Perform a search on the Github Issues to see if your bug or enhancement is already reported.
- [X] Try to reproduce the problem on a fresh install or on the demo site.
Rock Version
16.2
Client Culture Setting
en-US