Skip to content

Commit

Permalink
Merge pull request #92 from woprandi/master
Browse files Browse the repository at this point in the history
[BUG #8555] qx.util.Validate.email accepts any extension with more than 2 characters
  • Loading branch information
Tobias Oberrauch committed Sep 17, 2014
2 parents cb67a4d + a2454e5 commit f4911a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions framework/source/class/qx/test/util/Validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ qx.Class.define("qx.test.util.Validate",
this.assertException(function() {
qx.util.Validate.email("Custom Error Message")("not an email");
}, qx.core.ValidationError, "Custom Error Message");

//Valid since new domain extensions
qx.util.Validate.email()("foo@bar.qooxdoo");
},

testString : function()
Expand Down
2 changes: 1 addition & 1 deletion framework/source/class/qx/util/Validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ qx.Class.define("qx.util.Validate",
errorMessage = errorMessage ||
qx.locale.Manager.tr("'%1' is not an email address.", (value || ""));

var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,})$/;
if (reg.test(value) === false) {
throw new qx.core.ValidationError("Validation Error",errorMessage);
}
Expand Down

0 comments on commit f4911a2

Please sign in to comment.