php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52334 not allowing urls with hyphens in the domain
Submitted: 2010-07-14 09:15 UTC Modified: 2010-07-14 09:22 UTC
From: code at margni dot com Assigned:
Status: Duplicate Package: Filter related
PHP Version: 5.3.2 OS: *NIX
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:
23 - 3 = ?
Subscribe to this entry?

 
 [2010-07-14 09:15 UTC] code at margni dot com
Description:
------------
hyphen (-) is a valid character in a domain name

Test script:
---------------
var_dump(filter_var('http://www.foo-bar.com', FILTER_VALIDATE_URL));

Expected result:
----------------
'http://www.foo-bar.com'

Actual result:
--------------
FALSE

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-14 09:18 UTC] rasmus@php.net
-Status: Open +Status: Duplicate
 [2010-07-14 09:18 UTC] rasmus@php.net
Already reported and fixed in 5.3.3
 [2010-07-14 09:19 UTC] code at margni dot com
-: stephen@margni.com +: code at margni dot com
 [2010-07-14 09:19 UTC] code at margni dot com
fixed my email
 [2010-07-14 09:20 UTC] code at margni dot com
-Status: Duplicate +Status: Closed
 [2010-07-14 09:20 UTC] code at margni dot com
great!
 [2010-07-14 09:22 UTC] pajoye@php.net
-Status: Closed +Status: Duplicate
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 15 04:01:34 2019 UTC