ZF-11334: Zend_Validate_Hostname does not identify IPv6 addresses properly

Issue Type: Bug Created: 2011-04-30T05:17:51.000+0000 Last Updated: 2011-08-25T19:49:14.000+0000 Status: Resolved Fix version(s): - 1.11.6 (05/May/11)

Reporter: Adam Lundrigan (adamlundrigan) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Validate

Related issues: - ZF-11188

Attachments: - ZF-11334.patch


Zend_Validate_Hostname Line 505-506 checks to see if the argument to isValid is an IP address, and if so checks to see if it is a valid IP:

<pre class="highlight">
if (preg_match('/^[0-9.a-e:.]*$/i', $value) &&
            $this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {

Notice that the preg express accepts only hex characters A through E, omitting F.

See: for IPv6 address examples used in tests


Posted by Adam Lundrigan (adamlundrigan) on 2011-04-30T05:30:08.000+0000

Reproducing test case plus fix. Applying patch had no visible consequence w.r.t execution of test suite.

Posted by Adam Lundrigan (adamlundrigan) on 2011-04-30T05:31:34.000+0000

Fixed in trunk r23900

Posted by Thomas Weidner (thomas) on 2011-05-01T07:05:18.000+0000

Reassigning to component author

Posted by Ralph Schindler (ralph) on 2011-05-03T15:23:06.000+0000

Thomas, why did you reassign? Is this commit bad? It seems complete- do you need to do any more to this?

Posted by Ralph Schindler (ralph) on 2011-05-03T16:19:53.000+0000

Re-assigning to Adam for bug-hunt credit, verified fix and will merge.

Posted by Ralph Schindler (ralph) on 2011-05-03T16:26:57.000+0000

Fixed in release branch 1.11 at r23972

Posted by Thomas Weidner (thomas) on 2011-07-13T08:13:10.000+0000

@Ralph: As I did not get reply on my mails I am asking you this way if I am allowed to add this to ZF2 or if you still want me not to touch components where I am the maintainer. A duplication was also not wanted, so please state how things should be done correct, or state if ZF1 issues should not be solved for ZF2

Posted by Thomas Weidner (thomas) on 2011-08-25T19:49:14.000+0000

Added to ZF2 with GH-276 I hope this was correct as there was no response to my previous question

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.