Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Email address validation expression fails some valid emails that use Plus Addressing

Open SteveSwaringen opened this issue 1 year ago • 0 comments

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 . between john and doe.

  • Click Save. This time, the prayer request will save. image

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

SteveSwaringen avatar Apr 02 '24 16:04 SteveSwaringen