Skip to content
This repository was archived by the owner on Jan 31, 2018. It is now read-only.

Commit 1c6e229

Browse files
committed
[bug #1005001] Add + in email addresses
1 parent 7242e77 commit 1c6e229

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fjord/base/static/js/fjord_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ window.fjord = window.fjord || {};
55
* Validates a string as an email address
66
*/
77
fjord.validateEmail = function(text) {
8-
var emailRegExp = /^[a-zA-Z0-9._\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,6}$/;
8+
var emailRegExp = /^[a-zA-Z0-9._\-\+]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,6}$/;
99
if (text.length > 0 && text.match(emailRegExp)) {
1010
return true;
1111
}

fjord/base/static/tests/test_fjord_utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ test("basic email validation", function() {
55
['abc', false],
66
['foo@', false],
77
['foo@example.com', true],
8-
['foo.bar@baz.example.com', true]
8+
['foo.bar@baz.example.com', true],
9+
['foo+bar@baz.example.com', true]
910
];
1011

1112
for (i=0; i < test_data.length; i++) {

0 commit comments

Comments
 (0)