-
Notifications
You must be signed in to change notification settings - Fork 2
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
PHP Deprecated: idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated in /wire/core/Sanitizer.php:550 #616
Comments
…g deprecation notices for default arguments of idn_to_utf8() and idn_to_ascii(). The deprecation change and new defaults for next major PHP version does not appear to affect our usage after several tests, so opted to suppress these notices.
Thanks, I've pushed a fix. |
Hey @ryancramerdesign - is that really the best solution? Maybe I am missing something, but it's not the Have a read here: roundcube/roundcubemail#6075 |
Yeah I originally coded it that way, but it left me having to do PHP version detection, determine whether the define was available (since it was added in PHP 5.4 apparently). Messy conditionals for a simple function call. Then it was requiring that the $options and $variant arguments be passed by reference, meaning more code. Then PhpStorm had some other inexplicable complaint about the function call arguments, which is probably a PhpStorm bug, but I don't want to see that red flag every time I edit Sanitizer. Then I read that some people are seeing issues after changing the $variant argument to the new flag, because the PHP version supports it, but the underlying system library doesn't (apparently an issue on some web hosts). I did some research on why they are throwing deprecated notices for the default arguments on this function, which demands an explanation. It turns out they are changing the default $variant argument to the newly suggested one in the next major version of PHP. The deprecation notice is there to let people know the defaults are changing (and old default being dropped as an option), as there may be cases where it matters, so throwing the notice actually makes sense despite being a bit odd. I tested with what will be the new default $variant in the next major PHP version, and found it produced identical results for our use cases as the current defaults. I concluded that accepting the default arguments for these functions, regardless of PHP version, seems to be a safer bet, and doesn't require a bunch of extra messy support code, so this is one of the rare cases where the suppression operator seemed to make more sense. Though please let me know if you find PHP 7.2 is bypassing that suppression operator. |
Thanks for the detailed explanation Ryan - I should have realized that you had looked into it properly. |
Short description of the issue
Getting the title error in php 7.2
The text was updated successfully, but these errors were encountered: