click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clint Lawrence (JIRA)" <>
Subject [jira] [Created] (CLK-778) EmailField Data Validation Is Insufficient
Date Wed, 07 Sep 2011 17:19:09 GMT
EmailField Data Validation Is Insufficient

                 Key: CLK-778
             Project: Click
          Issue Type: Bug
          Components: extras
            Reporter: Clint Lawrence

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:

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}$",

    public void validate() {
        if (EMAIL_ADDRESS_REGEX_PATTERN.matcher(StringUtils.trimToEmpty(this.value)).matches())

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message