symphonycms/symphonycms

Symphony Deprecated Warning: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

bauhouse opened this issue · 2 comments

Affected Symphony version(s) : 3.0.0
PHP version(s) : 7.3.7
MySQL version(s): 5.7.26 Homebrew
OS(es) : macOS Catalina 10.15.3

Accessing the symphony admin returned the following error:

Symphony Deprecated Warning: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

An error occurred in /Users/stephen/Sites/symphonycms/symphony/lib/boot/func.utilities.php around line 28

23     // convert idn back to ascii for redirect
24 
25     if (function_exists('idn_to_ascii')) {
26         $root = parse_url(URL);
27         $host = $root['host'];
28         $url  = str_replace($host, idn_to_ascii($host), $url);
29     }
30 
31     cleanup_session_cookies();
32     header('Status: 302 Found');

The error was solved by changing line 28 of func.utilities.php from this:

$url  = str_replace($host, idn_to_ascii($host), $url);	

to this:

$url  = str_replace($host, idn_to_ascii($host,0,INTL_IDNA_VARIANT_UTS46), $url);

based on a similar error reported here.

where do you get this error?

@bauhouse Seems like we patch it in defines but not in functions. I've push a commit if you want to try the fix