Skip to content

Commit

Permalink
Closes issue zxing#517 : crude email validator in encoder web app sho…
Browse files Browse the repository at this point in the history
…uld not restrict last domain element to 6 chars. "[email protected]" should be fine
  • Loading branch information
srowen committed Dec 7, 2015
1 parent d5c6fab commit 58108df
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static boolean isBasicallyValidURI(String uri) {

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.");
}
}
Expand Down

0 comments on commit 58108df

Please sign in to comment.