Req #81628 [NEW]: Make intl IDNA 2008 compliant

From: Date: Tue, 16 Nov 2021 20:00:31 +0000
Subject: Req #81628 [NEW]: Make intl IDNA 2008 compliant
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237795@lists.php.net to get a copy of this message
From:             jbernard at cofomo dot com
Operating system: Linux and Windows
PHP version:      8.0.12
Package:          I18N and L10N related
Bug Type:         Feature/Change Request
Bug description:Make intl IDNA 2008 compliant

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.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=81628&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81628&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81628&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81628&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81628&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81628&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81628&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81628&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81628&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81628&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81628&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81628&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81628&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81628&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81628&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81628&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81628&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81628&r=mysqlcfg


Thread (2 messages)

« previous php.bugs (#237795) next »