-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated #163
Comments
Did a little digging and it looks like this was already fixed in master! #148 Looking forward to the next release! 🎉 |
think there's a better way to sort out that issue. As we all know that email library not supported in php 7.2 and that's why error occured. Quick Solution :
|
It's an easy way to solve this problem in a second. |
So what is the real solution to this? I am experiencing this error with version 4.11.0 in PHP 7.2 and I don't consider rolling back to PHP 7.1 to be a reasonable solution. Is PHP to blame for how this function is being called? It looks like symfony/polyfill is defining that constant. Maybe it shouldn't be? |
To avoid this issue in PHP 7.2, apparently two constants need to be defined but whose responsibility is that and what are the values supposed to be? I'm really surprised the PHP devs decided to deprecate that constant yet leave it as the default value for the third parameter of idn_to_ascii(). This screenshot is from the offending block of code in this library's Host.php file. |
@benjaminkohl Can you file a new bug for this? |
Was this satisfactorily resolved? I'm seeing errors similar to this in an app where this library is a dependency (Freescout): I'm seeing the following error on PHP 7.2 and above:
I'm not sure if this is a new issue or if I'm supposed to do something to get this to work reliably? Web Server: nginx/1.16.1 Any help or guidance would be appreciated. |
did freescout update to a newer version? :) |
The version used is 4.12, so, the PHP7.2+ compatibility should be fine according to your docs. That said, they completely dismissed the issue out of hand stating that the deprecation notice and the simultaneous 500 error that occurs are not related. While I agree that something that throws a deprecation notice isn't the specific culprit of the 500, the 500 still occurs and still stops the application from working when the notice is logged at PHP 7.2+. Thoughts? |
in 4.12 there is not supposed to be any occurrence of INTL_IDNA_VARIANT_2003. Can you grep in Freescout and see where the string INTL_IDNA_VARIANT_2003 occurs? |
Error occurs here on PHP7.3: https://github.com/ezyang/htmlpurifier/blob/master/library/HTMLPurifier/AttrDef/URI/Host.php#L103 |
The only way to fix this seems to be:
|
Is it ok to create a pull request for this #163 (comment)? PHP developers made a mistake for which there is no other solutions. |
We need a reproducer and #163 (comment) isn't a valid fix Did you check |
I'm getting this bizarre error in some cases under PHP 7.2. Apparently the idn_to_ascii function deprecated the
INTL_IDNA_VARIANT_2003
variant in PHP 7.2, and you're supposed to useINTL_IDNA_VARIANT_UTS46
instead now. However, PHP seems to be still usingINTL_IDNA_VARIANT_2003
as the default if none is specified. This ends up causing an exception.I think this is wrong behavior of PHP, but it would be easier to fix in this library calling the
idn_to_ascii
function. I've patched my running instance to callidn_to_ascii($string,0,INTL_IDNA_VARIANT_UTS46)
already.Has anyone else encountered this issue?
The text was updated successfully, but these errors were encountered: