php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #81628 Make intl IDNA 2008 compliant
Submitted: 2021-11-16 20:00 UTC Modified: 2021-11-17 15:07 UTC
From: jbernard at cofomo dot com Assigned:
Status: Suspended Package: I18N and L10N related
PHP Version: 8.0.12 OS: Linux and Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jbernard at cofomo dot com
New email:
PHP Version: OS:

 

 [2021-11-16 20:00 UTC] jbernard at cofomo dot com
Description:
------------
I am conducted some tests on idn_to_ascii and idn_to_utf8 methods from intl extension. See the test script example for $flags.

Those 2 methods are mainly used for domain names conversion and therefore should comply with IDNA 2008 (RFC 5891) and not only UTS#46.
During my tests, the following input domains were considered valid by idn_to_ascii while they contain DISALLOWED character in IDNA 2008:
 - ????????????????????????????????.????????????
 - 〈普遍接受-测试.世界
 - Ė.ua-test.top

See https://util.unicode.org/UnicodeJsps/idna.jsp?a=%F0%90%8D%81%F0%90%8D%83%F0%90%8C%B9%F0%90%8C%BF%F0%90%8D%88%F0%90%8C%B3%F0%90%8C%B5%F0%90%8C%BF.%F0%90%8C%B2%F0%90%8D%88%F0%90%8C%BC%0D%0A%E3%80%88%E6%99%AE%E9%81%8D%E6%8E%A5%E5%8F%97-%E6%B5%8B%E8%AF%95.%E4%B8%96%E7%95%8C%0D%0A%C4%96.ua-test.top

Test script:
---------------
$result = idn_to_ascii($input,
    IDNA_DEFAULT
    | IDNA_USE_STD3_RULES
    | IDNA_CHECK_BIDI
    | IDNA_CHECK_CONTEXTJ
    | IDNA_NONTRANSITIONAL_TO_ASCII,
    INTL_IDNA_VARIANT_UTS46, $idnaInfo);
echo $result;

Expected result:
----------------
idn_to_ascii whould return null and $idn_info should contain error IDNA_ERROR_DISALLOWED with those domains:
 - ????????????????????????????????.????????????
 - 〈普遍接受-测试.世界
 - Ė.ua-test.top

Actual result:
--------------
idn_to_ascii converts those domains to A-label without error.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-17 15:07 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2021-11-17 15:07 UTC] cmb@php.net
The ICU documentation[1] states:

| IDNA2008 is implemented according to UTS #46, […]

So that would be an upstream issue[2].  I suspend this ticket
until that is resolved.

[1] <https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/uidna_8h.html#details>
[2] <https://unicode-org.atlassian.net/jira/software/c/projects/ICU/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC