ZF-12329: Hostname validation for valid local hostname with ALLOW_ALL returns error on getErrors

Description

The Validator Zend_Validate_Hostname returns an error if allow is set to ALLOW_ALL and the hostname is a local hostname. Following Testcode returns true on isValid and the error hostnameInvalidHostname on getErrors.

$hostname = 'localhost'; $validator = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL); if($validator->isValid($hostname)) { var_dump($validator->getErrors()); }

Comments

The isValid() method sets errors with _error(), but returns true later on. Is this intended behavior and what is the rationale behind it if it is intended?

Other validators usually return false after calling _error().