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

Issue Type: Bug Created: 2012-07-10T10:08:59.000+0000 Last Updated: 2012-08-02T08:50:34.000+0000 Status: Open Fix version(s): Reporter: Juergen E. (wdceejer) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments:


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()); }


Posted by Stefan Stubbe (stefan.stubbe) on 2012-08-02T08:50:34.000+0000

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().

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.