Skip to content

Commit

Permalink
Merge for fix email validation
Browse files Browse the repository at this point in the history
  • Loading branch information
hotoo committed Feb 9, 2015
2 parents 04351aa + f276ea7 commit e7dae51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ function verifyIsUrl(value, validity){
}


var RE_EMAIL = /^\w+(?:[\._+\-]\w+)*@\w+(?:\.\w+)+$/;
var RE_EMAIL = /^\w+(?:[\._+\-]\w+)*@[\w_-]+(?:\.[\w_-]+)+$/;
function verifyIsEmail(value, validity){
var certified = RE_EMAIL.test(value);
validity.typeMismatch = !certified;
Expand Down
5 changes: 5 additions & 0 deletions tests/univ-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4248,6 +4248,11 @@ var testCases = [
"data": { a: "a@b.c" },
"test": testValid
},
{
"rule": { a: { type: "email" } },
"data": { a: "a@b-inc.c" },
"test": testValid
},
{
"rule": { a: { type: "email" } },
"data": { a: "abc@def.ghi" },
Expand Down

0 comments on commit e7dae51

Please sign in to comment.