fix(regex): allow "=" in valid email address

Fixes T3440 Email formatting validation bug
This commit is contained in:
Evan Morikawa 2015-08-31 15:48:39 -07:00
parent 73dc68e46e
commit 8b86973a82
2 changed files with 2 additions and 1 deletions

View file

@ -98,6 +98,7 @@ describe "ContactStore", ->
"spang \"Christine Spang\" <noreply+phabricator@nilas.com>": [new Contact(name: "spang \"Christine Spang\"", email: "noreply+phabricator@nilas.com")]
"Evan (evan@nylas.com)": [new Contact(name: "Evan", email: "evan@nylas.com")]
"\"Michael\" (mg@nylas.com)": [new Contact(name: "Michael", email: "mg@nylas.com")]
"announce-uc.1440659566.kankcagcmaacemjlnoma-security=nylas.com@lists.openwall.com": [new Contact(name: "announce-uc.1440659566.kankcagcmaacemjlnoma-security=nylas.com@lists.openwall.com", email: "announce-uc.1440659566.kankcagcmaacemjlnoma-security=nylas.com@lists.openwall.com")]
# Multiple contact test cases
"Evan Morikawa <evan@nylas.com>, Ben <ben@nylas.com>": [

View file

@ -7,7 +7,7 @@ RegExpUtils =
# It's also imporant we return a fresh copy of the RegExp every time. A
# javascript regex is stateful and multiple functions using this method
# will cause unexpected behavior!
emailRegex: -> new RegExp(/([a-z.A-Z0-9%+_-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/g)
emailRegex: -> new RegExp(/([a-z.A-Z0-9%+=_-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/g)
# https://regex101.com/r/zG7aW4/3
imageTagRegex: -> /<img\s+[^>]*src="([^"]*)"[^>]*>/g