Edit report at http://bugs.php.net/bug.php?id=51192&edit=1
ID: 51192
Updated by: aharvey@php.net
Reported by: solar at azrael dot ws
Summary: FILTER_VALIDATE_URL will invalidate a hostname that
includes '-'
-Status: Open
+Status: Assigned
Type: Bug
Package: Filter related
Operating System: linux
PHP Version: 5.2.13
Assigned To: aharvey
New Comment:
Yeah, that doesn't quite look right. :)
Cheers for the patch; I'll cook up a test script to go with it and
commit it.
Previous Comments:
------------------------------------------------------------------------
[2010-03-03 09:50:24] aharvey@php.net
Yeah, that doesn't quite look right. :)
Cheers for the patch; I'll cook up a test script to go with it and
commit it.
------------------------------------------------------------------------
[2010-03-03 09:41:07] solar at azrael dot ws
Changes summary. That was too long.
------------------------------------------------------------------------
[2010-03-03 08:56:18] solar at azrael dot ws
Oops.
Test script:
var_dump(filter_var('http://example.com',
FILTER_VALIDATE_URL));
var_dump(filter_var('http://exa-mple.com',
FILTER_VALIDATE_URL));
var_dump(filter_var('http://exa_mple.com',
FILTER_VALIDATE_URL));
------------------------------------------------------------------------
[2010-03-03 08:49:39] solar at azrael dot ws
Description:
------------
Hostname must contain only alpha-numeric letters and the hyphen(-).
Test script:
---------------
var_dump(filter_var(
Expected result:
----------------
string(18) "http://example.com"
string(19) "http://exa-mple.com"
bool(false)
Actual result:
--------------
string(18) "http://example.com"
bool(false)
string(19) "http://exa_mple.com"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51192&edit=1