php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75156 idn_to_ascii() issues E_DEPRECATED no matter what options are passed
Submitted: 2017-09-04 16:48 UTC Modified: 2017-09-13 16:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jocrutrisi at ibsats dot com Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: 7.2.0RC1 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jocrutrisi at ibsats dot com
New email:
PHP Version: OS:

 

 [2017-09-04 16:48 UTC] jocrutrisi at ibsats dot com
Description:
------------
Apparently the 2003 variant of encoding was deprecated in 7.2, but no matter what variant I pass, I get the same deprecation error "Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated"

This looks like a bug.

Test script:
---------------
echo(idn_to_ascii("здравей"));
echo(idn_to_ascii("здравей", INTL_IDNA_VARIANT_2003));
echo(idn_to_ascii("здравей", INTL_IDNA_VARIANT_UTS46));
echo(idn_to_ascii("здравей", IDNA_NONTRANSITIONAL_TO_ASCII));

Expected result:
----------------
At least one of those shouldn't issue a warning...

Actual result:
--------------
Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in /in/MPSvP on line 2
xn--80aeeggq9b
Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in /in/MPSvP on line 3
xn--80aeeggq9b
Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in /in/MPSvP on line 4
xn--80aeeggq9b
Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in /in/MPSvP on line 5
xn--80aeeggq9b

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-04 21:52 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2017-09-04 21:52 UTC] cmb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

$variant is supposed to be third parameter of idn_to_ascii(), see
<http://php.net/manual/en/function.idn-to-ascii.php> and
<https://3v4l.org/iPJ09>.
 [2017-09-05 14:46 UTC] jocrutrisi at ibsats dot com
The documentation of this function says only a specific argument value is deprecated, yet no matter what value is passed it shows the E_DEPRECATED value. Why is this marked "not a bug" without explanation?

Either is the documentation incorrect, or it's a bug. One or the other.
 [2017-09-05 14:52 UTC] anrdaemon at freemail dot ru
echo(idn_to_ascii("здравей"));
echo(idn_to_ascii("здравей", 0, INTL_IDNA_VARIANT_2003));
echo(idn_to_ascii("здравей", 0, INTL_IDNA_VARIANT_UTS46));
echo(idn_to_ascii("здравей", 0, IDNA_NONTRANSITIONAL_TO_ASCII));

Again, you're supposed to pass $variant as the THIRD parameter, not second ($options).
 [2017-09-05 14:57 UTC] jocrutrisi at ibsats dot com
So I found the culprit. As usual, I was fed outdated information by PHP.net through a localized version of the docs. http://php.net/manual/bg/function.idn-to-ascii.php
 
Ponder this:

1. I've selected preferred language English.
2. It keeps redirecting me to Bulgarian pages.
3. Shows content in English anyway...
4. ... but heavily outdated!

Talk about confusing. I've reported this ages ago, but nobody cares I guess.
 [2017-09-13 16:45 UTC] cmb@php.net
> 1. I've selected preferred language English.
> 2. It keeps redirecting me to Bulgarian pages.

If the language code is explicitly given in the URL, this is
supposed to override your language preference. Cf.
<http://php.net/manual/bg/function.idn-to-ascii.php> vs.
<http://php.net/manual/function.idn-to-ascii.php>.

> 3. Shows content in English anyway...

That is because this page has never been translated into
Bulgarian.

> 4. ... but heavily outdated!

This is because the Bulgarian translation has been marked as
unavailable, but for some reason the contents are still left on
the servers or even still rolled out.

> I've reported this ages ago, but nobody cares I guess.

Contributions are welcome! :)

For now, at least there is a subtle indication that you've come to
an unsupported translation: the language selector shows "Other".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC