[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-user
Subject: Re: [validator] EmailValidator accept empty domain names
From: Ralph Goers <ralph.goers () dslextreme ! com>
Date: 2015-10-25 7:07:21
Message-ID: 9D946DD1-06B2-42B1-B951-DB37C7BB8A7A () dslextreme ! com
[Download RAW message or body]
Please see VALIDATOR-376. I just committed the fix for this. FYI - commons-validator 1.4 does not have this behavior.
Ralph
> On Oct 22, 2015, at 12:05 AM, Sébastien De Nef <sebastien.denef@gmail.com> wrote:
>
> Hi everybody,
>
> First, sorry for my english.
>
> I tried the EmailValidator component and I was surprised that it accepts a
> domain part that contains only the TLD (like joe@.org). See below a failing
> test.
>
> Although domainValidator.isValid(domain) returns false
> domainValidator.isValid(domain) || domainValidator.isValidTld(domain)
> returns true
> Is it the source of the problem ? Why does it bypass the domain validation
> if the TLD is valid ?
> NB: DomainValidator.isValid already contains isValidTld()
>
> Sébastien
>
> /**
> * Tests the email validation for empty domain.
> */
> public void testEmailWithEmptyDomain() {
> assertFalse("empty domain name should fail",
> emailValidator.commonsValidator("joe@"));
> assertFalse("domain name starting with dot should fail",
> emailValidator.commonsValidator("joe@.apache.org"));
> assertFalse("domain name with only TLD should fail",
> emailValidator.commonsValidator("joe@.org")); // yes or no ?
> }
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic