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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
2 + 19 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 23:01:30 2024 UTC