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 <[email protected]> 
> 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 [email protected]). 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("[email protected]"));
>    assertFalse("domain name with only TLD should fail",
> emailValidator.commonsValidator("[email protected]")); // yes or no ?
> }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to