zendframework / zend-validator

Validator component from Zend Framework
BSD 3-Clause "New" or "Revised" License
181 stars 136 forks source link

Hostname validation not correct when not checking TLD #255

Closed SiebeVE closed 5 years ago

SiebeVE commented 5 years ago

I have a use case were I check a hostname but don't want to check the tld,

$validator = new \Zend\Validator\Hostname([
    'useTldCheck' => false,
    'allow' => $allow,
 ]);
$validator->isValid('unvalid_domain.be'); // true

This results in true, but this should be false.