• Bug#1090260: Reassign: Bug#1090260: php-net-publicsuffix: FTBFS: PHP Fa

    From =?utf-8?B?0L3QsNCx?=@21:1/5 to Santiago Vila on Fri May 23 19:20:01 2025
    Control: retitle -1 php8.4-intl: idn_to_ascii("") throws ValueError ‒ regression from bookworm
    Control: reassign -1 php8.4-intl 8.4.6-2
    Control: affects -1 php-net-publicsuffix

    On Mon, Dec 16, 2024 at 05:51:30PM +0000, Santiago Vila wrote:
    Package: src:php-net-publicsuffix
    Version: 0.2-1.1
    Severity: serious
    Tags: ftbfs

    Dear maintainer:

    During a rebuild of all packages in unstable, your package failed to build:

    --------------------------------------------------------------------------------
    [...]
    debian/rules build
    dh build
    dh: warning: Compatibility levels before 10 are deprecated (level 9 in use)
    dh_update_autotools_config
    debian/rules override_dh_auto_test
    make[1]: Entering directory '/<<PKGBUILDDIR>>'
    ./test.php
    PHP Fatal error: Uncaught ValueError: idn_to_ascii(): Argument #1 ($domain) must not be empty in /<<PKGBUILDDIR>>/Net/PublicSuffix.php:89
    Stack trace:
    #0 /<<PKGBUILDDIR>>/Net/PublicSuffix.php(89): idn_to_ascii()
    #1 /<<PKGBUILDDIR>>/Net/PublicSuffix.php(144): Net_PublicSuffix::_canonicalize()
    #2 /<<PKGBUILDDIR>>/Net/PublicSuffix.php(47): Net_PublicSuffix->get_registered_domain()
    #3 /<<PKGBUILDDIR>>/test.php(21): Net_PublicSuffix::registered_domain()
    #4 /<<PKGBUILDDIR>>/test.php(33) : eval()'d code(5): checkPublicSuffix()
    #5 /<<PKGBUILDDIR>>/test.php(33): eval()
    #6 {main}
    thrown in /<<PKGBUILDDIR>>/Net/PublicSuffix.php on line 89
    make[1]: *** [debian/rules:6: override_dh_auto_test] Error 255
    make[1]: Leaving directory '/<<PKGBUILDDIR>>'
    make: *** [debian/rules:3: build] Error 2
    dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

    This is a regression from bookworm php8.2-intl 8.2.28-1~deb12u1:
    $ cat a.php
    <?php
    print(idn_to_ascii("gaming") . "\n");
    print(idn_to_ascii("гаминг") . "\n");
    print(idn_to_ascii("") . "\n");
    bookworm$ php a.php
    gaming
    xn--80afbtth

    sid$ php a.php
    gaming
    xn--80afbtth
    PHP Fatal error: Uncaught ValueError: idn_to_ascii(): Argument #1 ($domain) must not be empty in /srv/a.php:4
    Stack trace:
    #0 /srv/a.php(4): idn_to_ascii()
    #1 {main}
    thrown in /srv/a.php on line 4

    Nothing on https://www.php.net/manual/en/function.idn-to-ascii.php
    indicates a change after PHP 8 or this being invalid at all.

    Best,

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmgwrScACgkQvP0LAY0m WPFChA/9FW23dquXwYWAD4GiglThaupplK4pmL+g7TOnRGsumeVA1vN1Q5xXboMU Iak3qB20HR0ZO1FbaceYZk6ksKNI2/ue//AGFXheglH+/Ut+0ySI9G5if6wQQhne d+ZYpLbFtgss9LWZxMvxMBh2wqHR0vMnb9aEEOG3FrZ0RwhV1SPwrRU5nv6TH5wG XmWFAXT7jkNBUbSuOYQG/w1cjipGVr48f3xzN+vS5JLkfTFpVxGTgWCXDIMJM+GT SojNBvSIhswnbioi4K/LB9rJqZjtN260mZPSFcgC1XgDmStpAQc8rdVb/F1TyJM9 24OAwtlxqF8GcNo7ZvluEoOYtV2ylTlvzSlnj2uJ0UrI+t5fuCl0gX7nAtwCyxND XGDvybipxQ6phpWyxp82YznipB1BiAolVFUy1KVas80/TrFa3DNgV5QZkBjBx60b kYXXoLrnmnUwWMrJ6hNMje2JPHzP3lZH2Qaidmyvjgw7Yub9fGPYwoa5lcMyui9R DEzMKG8t+gkM28VEOsetjpNl8kysgGhvN9e8xO7ah/TZ+3LvD5O5fdP3lPF8JALE aPTKngFX9E3iivzenE/ZNhAQtGknWEmd/cmjVe0l804dhWOXqNvQvf/K2TX6x1Fy 2WZz23wfGvhw19WTQif3tEUMK6LJyY6h3ffSIdAzSQC4+dVHhow=
    =uls/
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?utf-8?B?0L3QsNCx?=@21:1/5 to All on Fri May 23 20:20:02 2025
    On Fri, May 23, 2025 at 07:41:20PM +0200, Ondřej Surý wrote:
    Sorry, but no - the usage of idn_to_ascii() is invalid in php-net-publicsuffix and you need to fix it there.

    The missing check got fixed in https://github.com/php/php-src/commit/33f1cf202ef1 and it's OK to make small changes like this when changing major versions.
    Well, it would be if it were documented I suppose,
    but the documentation doesn't mention this change,
    clearly documents that it returns string-or-false with no exceptions listed, doesn't note /any/ restriction on $domain,
    and the commit says "ext/intl: idn.c use ValueErrors where appropriate",
    taking "appropriate" to mean "all errors not from the decoder loop itself" (admittedly, PHP's false formatting fucked me diagnostically, I thought it were "").

    Whatever.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmgwuecACgkQvP0LAY0m WPGTRBAAm2ghnG82h61t1EPJs14ZfYUfXtbYx3df2qDcqN7jVtfK2KuvXvvL3S0b kEq1xrDhUNZGLzNMY9DkSyT3FKsMa9UxeVAaVDFZMA3OALmnv+bZVK/cJQEcv4dp D2BHylFdfLaG9VtvdA6lyKxOl17e2xxy3mX7BJznw86ELYHtwhXZZOQ5KTx/WrKF vw0KhBF7X940c1abE498IqPmn4SEhOp7alCXsVEwbnivlAoJ0u5GvQRwzdJ8fdFZ t5xuq2bKIlMqPsXDfsvjBYvBu1mz7stDfPPFlASciicSx058Vhh8i45aTb05e3lg IUoBOvrsKLokUSSBFhmNT7mSbwMy2U2IJ33YqB+PUn1QYKFOGxVlGbYmUJu0Ludb MEn4CFOxD4VIBVm1UPIOS4YimU/rRKMCHf3QyT0IeotR07oH6PmUdF9Y3AqqVksa cS6zIqBGBnfEmWeqIHXLho81eTB640jH7rZJ0lWxbK//UP9ze0lWVO1CRFQLSI+X aCeBflS2epxnfBqQRJXMqFtn7h1MxBDHe0lOKWDWfmrUGvGOLqBPyHUaoZ8OS2zb 7UbQHvkCvYnDdSOxuziDOrVhXqbcTJ6INFAmXDS+63Nc/t0LGSyXuXmfFIUVkGYT O+cpE/PiT4U/diOjTZEntHOq5QnLPSrx81GM+lR94Ec/1oD3XRc=
    =TOk5
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)