|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51632 filter_var fails to validate correct URL
Submitted: 2010-04-22 11:52 UTC Modified: 2010-04-23 04:50 UTC
From: zharkikh at i dot com dot ua Assigned:
Status: Duplicate Package: Unknown/Other Function
PHP Version: 5.3.2 OS: FreeBSD
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:
45 - 5 = ?
Subscribe to this entry?

 [2010-04-22 11:52 UTC] zharkikh at i dot com dot ua
Function filter_var seems to change it behavior when PHP upgraded from 5.2.4 to 5.3.2.
The next example work fine in 5.24 but fail in 5.3.2.
This problem was described in Bug #51305 (filter_var fails if domain name contain "-") and reported to be fixed in 5.2.13, but it is bubble again in 5.3.2 :

Test script:
$P = '';

Expected result:
----------------, so URL is valid

Actual result:
false, so URL provided evaluated as invalid


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-22 12:44 UTC]
-Status: Open +Status: Feedback
 [2010-04-22 12:45 UTC]
Please try using this snapshot:
For Windows:

PHP 5.3.2 was released on March 4, and the #51305 was fixed on March 3. It probably didn't make it into the release. It works for me on 5.3.3-dev built a few days ago.
 [2010-04-22 21:48 UTC]
This was fixed in svn a while ago.
 [2010-04-23 04:50 UTC]
-Status: Feedback +Status: Duplicate
 [2010-04-23 04:50 UTC]
To confirm, this didn't make 5.3.2. It should be in 5.3.3.

Closing duplicate: the original bug is bug #51192.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 18:05:53 2022 UTC