|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51660 FILTER_VAR returns FALSE on valid-Urls containing a minus sign
Submitted: 2010-04-25 11:36 UTC Modified: 2010-04-25 19:33 UTC
From: cimodev at me dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.3.2 OS: Linux (openSuse 11.0)
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:
Solve the problem:
38 - 1 = ?
Subscribe to this entry?

 [2010-04-25 11:36 UTC] cimodev at me dot com
PHP 5.3.2 (cli)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

FILTER_VAR returns false on valid URL's such "".
Without minus-sign it will return the string as positive result.

In Bug-Search I found the hint, that it already would be fixed in 5.2.13.
It seems, that in 5.3.2 this bug was born again 

Test script:
$url = "";
var_dump(filter_var($url, FILTER_VALIDATE_URL));

Expected result:
string ""

Actual result:
bool (false)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-25 19:33 UTC]
-Status: Open +Status: Bogus
 [2010-04-25 19:33 UTC]
It was already fixed. Thanks.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Nov 29 07:05:52 2022 UTC