Edit report at https://bugs.php.net/bug.php?id=51192&edit=1
ID: 51192
Updated by: rasmus@php.net
Reported by: solar at azrael dot ws
Summary: FILTER_VALIDATE_URL will invalidate a hostname that
includes '-'
Status: Closed
Type: Bug
Package: Filter related
Operating System: linux
PHP Version: 5.2.13
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
Years of ignoring what? This was fixed years ago in PHP 5.3.3
Previous Comments:
------------------------------------------------------------------------
[2012-07-26 14:28:27] bd9161b68a85 at e89800344727 dot anonbox dot net
Can you please fix it after years of ignoring it?
------------------------------------------------------------------------
[2010-08-13 08:49:47] aharvey@php.net
That also works as of 5.3.3 -- I actually own a couple of internationalised domains, so I'm
aware of the issue. :)
------------------------------------------------------------------------
[2010-08-13 08:39:26] ondrej@php.net
Please be aware that IDN (PunyCode) url can contain two consecutive hyphens, ie.
xn--hkyrky-ptac70bc.cz
is OK as well.
------------------------------------------------------------------------
[2010-04-07 02:43:39] aharvey@php.net
The fix for this hasn't been incorporated into any stable releases yet: it came after 5.2.13
was released and 5.3.2 was branched (and far too late in 5.3.2's release cycle to be ported
across).
Both versions 5.2.14 and 5.3.3 will include this bug fix.
------------------------------------------------------------------------
[2010-04-06 22:04:34] lupo at e-noise dot com
I am experiencing the same behavior with PHP 5.3.2 on Mac OSX. When hostname contains hyphens
filter_var() won't validate using the FILTER_VALIDATE_URL filter.
The test code posted by "solar at azrael dot ws" produces the following output:
string(18) "http://example.com"
bool(false)
string(19) "http://exa_mple.com"
------------------------------------------------------------------------
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=51192--
Edit this bug report at https://bugs.php.net/bug.php?id=51192&edit=1