[
https://issues.apache.org/jira/browse/CLK-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247380#comment-13247380
]
Naoki Takezoe commented on CLK-778:
-----------------------------------
> if valid email addresses are not validate which would break backward
> compatibility?
Valid email address would be also valid in the new validation rule.
So, In fact, I think this change would not make any effect to existing
applications.
> EmailField Data Validation Is Insufficient
> ------------------------------------------
>
> Key: CLK-778
> URL: https://issues.apache.org/jira/browse/CLK-778
> Project: Click
> Issue Type: Bug
> Components: extras
> Reporter: Clint Lawrence
> Assignee: Naoki Takezoe
>
> In the Click Extras project, the current EmailField validation does not
> sufficiently limit user input to the format of an email address. As an
> example, I loaded the Avoka examples site and was able to successfully submit
> the following as an email address in the Extra Form Controls page:
> how.can@this@be@[email protected]
> For my own use I have extended EmailField with the following additional
> validation logic:
> private static final Pattern EMAIL_ADDRESS_REGEX_PATTERN =
> Pattern.compile("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$",
> Pattern.CASE_INSENSITIVE);
> ...
> @Override
> public void validate() {
> super.validate();
> if
> (EMAIL_ADDRESS_REGEX_PATTERN.matcher(StringUtils.trimToEmpty(this.value)).matches())
> {
> this.setErrorMessage("email-format-error");
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira