Zend Framework

Zend_Validate_Hostname doesn't handle IDN for .EU

Details

  • Type: Patch Patch
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.1
  • Fix Version/s: 1.10.2
  • Component/s: Zend_Validate
  • Labels:
    None

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

Activity

Hide
Martin Fuxa added a comment -

HOWTO generate EU supported characters - moved to attachment.

Show
Martin Fuxa added a comment - HOWTO generate EU supported characters - moved to attachment.
Hide
Thomas Weidner added a comment -

Provided patch is errorous and will not be implemented

Show
Thomas Weidner added a comment - Provided patch is errorous and will not be implemented
Hide
Thomas Weidner added a comment -

Correct feature added with r21063

Show
Thomas Weidner added a comment - Correct feature added with r21063
Hide
Martin Fuxa added a comment -

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.

Show
Martin Fuxa added a comment - 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.
Hide
Thomas Weidner added a comment -

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

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.

Show
Thomas Weidner added a comment - According to IANA the sign ě is contained within the Latin Extended Charset but "í" within Latin Supplement Charset. For details please look here: http://www.eurid.eu/en/eu-domain-names/idns-eu/supported-unicode-characters 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.
Hide
Martin Fuxa added a comment -

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.

Show
Martin Fuxa added a comment - 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.
Hide
Martin Fuxa added a comment -

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

Show
Martin Fuxa added a comment - 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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: