Issues

ZF-12362: Not working Zend_Validate_Hostname is Punycode Format URI

Issue Type: Bug Created: 2012-08-09T01:56:16.000+0000 Last Updated: 2012-08-17T08:01:14.000+0000 Status: Open Fix version(s): Reporter: Hironao Sekine (oxalis-gps) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

  • validating

Related issues: Attachments:

Description

testscript: validate-host.php ===========

Zend\_Validate\_Hostname::ALLOW\_DNS, 'idn' => false, 'tld' => false, )); var\_dump($validator->isValid($punycode\_hostname)); var\_dump($validator->getMessages()); die(); // =================================== /\* bool(false) _/ /_ array(1) { _/ /_ ["hostnameCannotDecodePunycode"]=> _/ /_ string(98) "'xn--wgv71a119e.jp' appears to be a DNS hostname but the given punycode notation cannot be decoded" _/ /_ } \*/ =========== testscript:validate-host.php the point at issue: Zend/Validate/Hostname.php =================== Line: 596-601 if (strpos($domainPart, 'xn--') === 0) { $domainPart = $this->decodePunycode(substr($domainPart, 4)); if ($domainPart === false) { return false; } } and Line: 708-717 (in decodePunycode function) $separator = strrpos($encoded, '-'); if ($separator > 0) { for ($x = 0; $x < $separator; ++$x) { // prepare decoding matrix $decoded[] = ord($encoded[$x]); } } else { $this->\_error(self::CANNOT\_DECODE\_PUNYCODE); return false; } ### Comments Posted by Egor Chernodarov (eg321) on 2012-08-17T08:01:14.000+0000 Seems it's duplicate of . Please vote it.

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts