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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugs dot php dot net at moesen dot nu
New email:
PHP Version: OS:

 

 [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: Sun Dec 08 09:01:33 2024 UTC