Issues

ZF-9183: Zend_Validate_Hostname doesn't handle IDN for .EU

Issue Type: Patch Created: 2010-02-15T08:30:37.000+0000 Last Updated: 2012-07-04T12:36:26.000+0000 Status: Resolved Fix version(s): - 1.10.2 (24/Feb/10)

Reporter: Martin Fuxa (karelbarel) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: - ZF-11927

Attachments: - eu-generate-chars.php

Description

$hostname = 'háčky-čárky.eu'; $validator = new Zend_Validate_Hostname(); if ($validator->isValid($hostname)) { echo "OK"; } else { foreach ($validator->getMessages() as $message) { echo "$message\n"; } }

returns invalid result 'háčky-čárky.eu' appears to be a DNS hostname but cannot match against hostname schema for TLD 'eu' 'háčky-čárky.eu' does not appear to be a valid local network name

FIX (fixed trunk) diff library/Zend/Validate/Hostname.php trunk/Hostname.php 154d153 < * (.EU) European http://www.eurid.eu/en/eu-domain-names/idns-eu 204d202 < 'EU' => array(1 => '/^[\x{002d}0-9a-zàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůųŵŷźżžșțΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώабвгдежзийклмнопрстуфхцчшщъыьэюяἀἁἂἃἄἅἆἇἐἑἒἓἔἕἠἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷὀὁὂὃὄὅὐὑὒὓὔὕὖὗὠὡὢὣὤὥὦὧὰάὲέὴήὶίὸόὺύὼώᾀᾁᾂᾃᾄᾅᾆᾇᾐᾑᾒᾓᾔᾕᾖᾗᾠᾡᾢᾣᾤᾥᾦᾧᾰᾱᾲᾳᾴᾶᾷῂῃῄῆῇῐῑῒΐῖῗῠῡῢΰῤῥῦῧῲῳῴῶῷ]{1,63}$/iu'),

HOWTO generate EU supported characters see attachment

Comments

Posted by Martin Fuxa (karelbarel) on 2010-02-15T08:38:07.000+0000

HOWTO generate EU supported characters - moved to attachment.

Posted by Thomas Weidner (thomas) on 2010-02-15T14:56:25.000+0000

Provided patch is errorous and will not be implemented

Posted by Thomas Weidner (thomas) on 2010-02-15T15:04:33.000+0000

Correct feature added with r21063

Posted by Martin Fuxa (karelbarel) on 2010-11-25T07:12:55.000+0000

I would like reopen this issue, try

require './Zend/Validate/Hostname.php'; $zvh = new Zend_Validate_Hostname; if (!$zvh->isValid('svět-dětí.eu')) { foreach ($zvh->getMessages() as $m) { echo "$m\n"; } }

error output 'svět-dětí.eu' appears to be a DNS hostname but cannot match against hostname schema for TLD 'eu' 'svět-dětí.eu' does not appear to be a valid local network name

expected result - valid hostname (idn for eu)

Tested on 1.11.0 and 1.10.8 version.

Posted by Thomas Weidner (thomas) on 2011-01-06T14:47:41.000+0000

According to IANA the sign ě is contained within the Latin Extended Charset but "í" within Latin Supplement Charset. For details please look here: http://eurid.eu/en/eu-domain-names/…

According to IANA characters from multiple charactersets are not allowed to be combined in one IDN. This means for example that you can not use cyrilic signs in combination with greek signs. Only signs from the ASCII charset are allowed in combination with all other charsets.

Therefor this issue will not be reopened as the returned error is correct.

Posted by Martin Fuxa (karelbarel) on 2011-02-10T13:42:41.000+0000

I don't know if you are right, please see http://www.eurid.eu/en/content/whois-result světdětí (xn--svtdt-3sa23ac) Status REGISTERED

"You are not allowed to mix characters from different scripts (for example, Latin, Greek and Cyrillic)" imho Latin-1 supplement and Latin Extended-A are same scripts. I ask EURid for that.

Posted by Martin Fuxa (karelbarel) on 2011-06-02T21:35:47.000+0000

I would like reopen this issue, with reference to my ticket "rt.eurid.eu #107544 mixed characters" all Latin-* are same script and can be mixed. Please make proper validation. Thanks

You can test validity (length, mixing characters, etc.) of FQDN by http://www.eurid.eu/en/content/whois

Posted by Dawid SH (dawidsh) on 2012-05-28T12:53:37.000+0000

Unfortunately Zend_Validate_Hostname incorrectly validates Polish hostnames for TLD 'eu' witch characker 'ó'. As I can see, this char is not in validator character set in class Zend_Validate_Hostname:

    'EU'  => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',
        2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',
        3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu',
        4 => '/^[\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu',
        5 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu',
        6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'),

(http://eurid.eu/en/eu-domain-names/…: U+00F3 ó LATIN SMALL LETTER O WITH ACUTE)

Posted by Martin Fuxa (karelbarel) on 2012-07-04T12:36:26.000+0000

something new

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