Email Validation is not reliable
--------------------------------

                 Key: TAP5-1347
                 URL: https://issues.apache.org/jira/browse/TAP5-1347
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.1.0.5
            Reporter: Marcel Huber


The Class org.apache.tapestry5.validator.Email a regex Pattern to validate a 
email address. This Regex is not reliable! For instance a email address like: 
[email protected] OR steve.j...@app- are become valid!
I suggest to use the org.apache.commons.validator.EmailValidator.
In the Class org.apache.tapestry5.validator.Email I overwrote the validate 
function like this and the two email addresses are no more valid!

import org.apache.commons.validator.EmailValidator;
......
    public void validate(Field field, Void constraintValue, MessageFormatter 
formatter, String value)
            throws ValidationException
    {
        EmailValidator ev = EmailValidator.getInstance();
        if (!ev.isValid(value)) throw new 
ValidationException(buildMessage(formatter, field));
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to