symphonycms icon indicating copy to clipboard operation
symphonycms copied to clipboard

Symphony Deprecated Warning: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

Open bauhouse opened this issue 5 years ago • 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.

bauhouse avatar Mar 27 '20 21:03 bauhouse

where do you get this error?

wdebusschere avatar Mar 27 '20 21:03 wdebusschere

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

nitriques avatar Mar 30 '20 21:03 nitriques