php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51258 FILTER_VALIDATE_URL thinks dashes/hyphens in host name are invalid
Submitted: 2010-03-10 12:48 UTC Modified: 2010-03-10 13:29 UTC
From: bugs dot php dot net at moesen dot nu Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.3.2 OS: Debian Lenny using Dotdeb
Private report: No CVE-ID: None
 [2010-03-10 12:48 UTC] bugs dot php dot net at moesen dot nu
Description:
------------
FILTER_VALIDATE_URL does not allow dashes/hyphens in the host name. That's just silly.

Test script:
---------------
$ php -r 'var_dump(filter_var("http://www.something.com/", FILTER_VALIDATE_URL));'

$ php -r 'var_dump(filter_var("http://www.some-thing.com/", FILTER_VALIDATE_URL));'


Expected result:
----------------
$ php -r 'var_dump(filter_var("http://www.something.com/", FILTER_VALIDATE_URL));'
string(25) "http://www.something.com/"

$ php -r 'var_dump(filter_var("http://www.some-thing.com/", FILTER_VALIDATE_URL));'
string(26) "http://www.some-thing.com/"


Actual result:
--------------
$ php -r 'var_dump(filter_var("http://www.something.com/", FILTER_VALIDATE_URL));'
string(25) "http://www.something.com/"

$ php -r 'var_dump(filter_var("http://www.some-thing.com/", FILTER_VALIDATE_URL));'
bool(false)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-10 13:29 UTC] felipe@php.net
-Status: Open +Status: Bogus
 [2010-03-10 13:30 UTC] felipe@php.net
Hello, this bug already was fixed days ago.
See bug #51192

Anyway, thanks for reporting. :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 12:01:27 2024 UTC