XF 2.2 "INTL_IDNA_VARIANT_2003 is Deprecated" after XF 2.1 to XF 2.2 upgrade

CStrategies

Member
PHP version: 7.2.34
MySQL version: 10.2.34
XF 2.2.13

After upgrading from XF 2.1 to XF 2.2.13, when attempting to add a resource with the resource manager that includes URLs in the fields, we get an error ErrorException: [E_DEPRECATED] idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated src/XF/Util/Url.php:28.

Similar errors pop up from various places all tracing back to the idn conversions in XF/Util/Url. I'm aware I could silence these errors by turning off development mode, but wondering why there are deprecated URL conversion functions in XF 2.2.13 to begin with. Or am I misunderstanding what is taking place?
 
Solution
PHP version: 7.2.34
That's the problem.
Upgrade to PHP 8.0 and the error will be gone.

Screenshot_20230824-221600_Chrome.jpg

XenForo doesn't set parameter variant, so depending on the PHP version it might be the deprecated default INTL_IDNA_VARIANT_2003.

A workaround could be to explicitly set INTL_IDNA_VARIANT_UTS46 if that is available and fallback to bundled Symfony polyfill-intl-idn if it is not.
PHP version: 7.2.34
That's the problem.
Upgrade to PHP 8.0 and the error will be gone.

Screenshot_20230824-221600_Chrome.jpg

XenForo doesn't set parameter variant, so depending on the PHP version it might be the deprecated default INTL_IDNA_VARIANT_2003.

A workaround could be to explicitly set INTL_IDNA_VARIANT_UTS46 if that is available and fallback to bundled Symfony polyfill-intl-idn if it is not.
 
Last edited:
Solution
Top Bottom