Closes issue #517 : crude email validator in encoder web app should not restrict last domain element to 6 chars. "foo@bar.marketing" should be fine

This commit is contained in:
Sean Owen 2015-12-07 22:17:04 +00:00
parent d5c6fabfef
commit 58108dfe5e

View file

@ -54,7 +54,7 @@ final class Validators {
static void validateEmail(String email) throws GeneratorException {
//FIXME: we can have a better check for email here.
if (!email.matches("^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$")) {
if (!email.matches("^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$")) {
throw new GeneratorException("Email is not valid.");
}
}