ezyang / ezyang/htmlpurifier

idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated

Open
#163 14 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

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 use INTL_IDNA_VARIANT_UTS46 instead now. However, PHP seems to be still using INTL_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 call idn_to_ascii($string,0,INTL_IDNA_VARIANT_UTS46) already.

Has anyone else encountered this issue?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the library's call to idn_to_ascii and inspect how its arguments are passed under PHP 7.2. Compare the current behavior with the reported INTL_IDNA_VARIANT_UTS46 usage; done means IDN conversion no longer triggers the deprecated-variant exception in the affected cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.