You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Frederic Boutin (JIRA)" <ji...@apache.org> on 2018/11/22 16:24:00 UTC

[jira] [Created] (VALIDATOR-449) Leading and trailing spaces in EmailValidator should not be valid

Frederic Boutin created VALIDATOR-449:
-----------------------------------------

             Summary: Leading and trailing spaces in EmailValidator should not be valid
                 Key: VALIDATOR-449
                 URL: https://issues.apache.org/jira/browse/VALIDATOR-449
             Project: Commons Validator
          Issue Type: Bug
          Components: Routines
    Affects Versions: 1.6
            Reporter: Frederic Boutin


I feel that:
 EmailValidator.getInstance(true).isValid(" some@email.com ");
should return false, but the regex used in EmailValidator matches this string. Furthermore, the following user + domain validation is done only on "some" and "email.com", respectively. This is because the regex captures the user and domain without the space.

I know the documentation states : "This implementation is not guaranteed to catch all possible errors in an email address" but, I think this case is simple enough to be in the validator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)