Bug->Req #53474 [Opn]: FILTER_VALIDATE_URL should not fail URL's that use IDN

From: Date: Thu, 05 Nov 2020 13:03:52 +0000
Subject: Bug->Req #53474 [Opn]: FILTER_VALIDATE_URL should not fail URL's that use IDN
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230126@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53474&edit=1

 ID:                 53474
 Updated by:         cmb@php.net
 Reported by:        gunther at keryx dot se
 Summary:            FILTER_VALIDATE_URL should not fail URL's that use
                     IDN
 Status:             Open
-Type:               Bug
+Type:               Feature/Change Request
 Package:            Filter related
 Operating System:   All
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

> […] but the current behavior is not exactly a bug. This is more
> a feature request.

That.

As workaround, you can apply idn_to_ascii() manually:
<https://3v4l.org/gae31>.


Previous Comments:
------------------------------------------------------------------------
[2016-09-26 11:49:56] cmb@php.net

Related To: Bug #73176

------------------------------------------------------------------------
[2015-01-03 15:56:50] kassner@php.net

Reproducible on PHP 5.5.20.

------------------------------------------------------------------------
[2014-04-18 02:24:17] scif-1986 at ya dot ru

That bug will become 4 years old soon. Any progress?

------------------------------------------------------------------------
[2010-12-07 01:22:28] cataphract@php.net

IDN refers only to the domain name. http://➡.ws/䨹
includes also a non-ascii characters in the path portion.

That part is bogus. http://aaa.ws/䨹 is not a proper
unambiguous URL, how 䨹 is encoded depends on the encoding (%E4%A8%B9 for UTF-8, but no standard
requires it). As to IDNs, I agree with aharvey, I suppose we could add a new flag, but the current
behavior is not exactly a bug. This is more a feature request.

------------------------------------------------------------------------
[2010-12-06 10:42:45] aharvey@php.net

To be completely clear, filter_var(..., FILTER_VALIDATE_URL) already
handles internationalised domain names in their canonical Punycode
form. I guess what this is really going to boil down to is whether
filter_var() should also support IDN when it's represented in a
Unicode character set, given that's really an intermediate
representation for the user's benefit.

My initial feeling on that is "not by default", but I guess we could
look at a flag for that filter (FILTER_FLAG_IDN_UTF8 or similar) which
enabled support for a particular character set (probably UTF-8).

Thoughts?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=53474


--
Edit this bug report at https://bugs.php.net/bug.php?id=53474&edit=1


Thread (9 messages)

« previous php.bugs (#230126) next »