Jeff Deskins wrote:
A user kept getting an email validation error when entering his email
address (ex: [EMAIL PROTECTED]) on one of our sites that uses Struts.
Apparently, the Struts email validation doesn't like the 4 character domain
qualifier (.info in this case - I believe there may be others).
I looked in validateEmail.js which is in commons-validator.jar and found the
following code:
var domArr=domain.match(atomPat);
var len=domArr.length;
if ((domArr[domArr.length-1].length < 2) ||
(domArr[domArr.length-1].length > 3)) {
return false;
}
if (len < 2) {
return false;
}
It looks like any domain qualifier greater than 3 is returning false in the
checkEmail function.
Is this a bug and/or can I extract the validateEmail.js file and make the
change and then re-jar commons-validator.jar?
I searched the archives and didn't find any mention of this.
I'd call that a bug; the restriction to 2-3 character TLDs is outdated.
I would suggest filing an enhancement request against Commons Validator
for that. Modifying your local copy of validateEmail.js as you suggest
would be a reasonable work-around in the meantime, although if the same
restriction exists in the Java (server-side) validation logic, you'd
need to fix it there too and re-compile.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]