Skip to content
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

warning "idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated" with PHP 7.2 #6075

Closed
hannob opened this issue Dec 1, 2017 · 5 comments
Closed

Comments

@hannob
Copy link

hannob commented Dec 1, 2017

When running latest roundcube 1.3.3 with PHP 7.2 I get warnings in my log:
PHP Deprecated: idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated in [path]/htdocs/program/lib/Roundcube/rcube_utils.php on line 880

I don't find "INTL_IDNA_VARIANT_2003" anywhere in the code, so I guess it's somehow set implicitly.

@alecpl
Copy link
Member

alecpl commented Dec 1, 2017

That's a PHP bug. They made that variant deprecated, but did not changed the default value of 3rd argument of idn_to_utf8(). Not smart. I suppose we'd need to set it explicitely.

http://php.net/manual/en/function.idn-to-utf8.php

@alecpl alecpl added this to the 1.3.4 milestone Dec 1, 2017
@hannob
Copy link
Author

hannob commented Dec 1, 2017

oh yeah, that's truly a PHP bug. I'll report it to upstream, let's see what happens, if they decide to fix it quickly and it'll be no more issue in 7.2.1 then maybe no fix is needed in roundcube.

@hannob
Copy link
Author

hannob commented Dec 1, 2017

Bug report at PHP: https://bugs.php.net/bug.php?id=75609

@hannob
Copy link
Author

hannob commented Dec 2, 2017

As weird as it sounds, it seems PHP did this intentionally. See discussion in linked bug and here:
https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003

While I strongly disagree with PHP here and think this is incredibly illogical, I have doubts they'll change their opinion given that PHP 7.2 is already out. Probably the best course of action is to explicitly set the variant to INTL_IDNA_VARIANT_UTS46 and add a comment that this change can be reverted in a few years when PHP 7.4 is the new norm and idn_to_utf8() can be used in its default mode without warnings again.

@alecpl
Copy link
Member

alecpl commented Dec 3, 2017

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants