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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 23:03:15 2021 UTC