php.net |  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
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: zharkikh at i dot com dot ua
New email:
PHP Version: OS:

 

 [2010-04-22 11:52 UTC] zharkikh at i dot com dot ua
Description:
------------
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:
---------------
<?php
$P = 'http://m-zharkikh.livejournal.com/26556.html';
echo filter_var($P, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);


Expected result:
----------------
http://m-zharkikh.livejournal.com/26556.html, so URL is valid

Actual result:
--------------
false, so URL provided evaluated as invalid

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-22 12:44 UTC] degeberg@php.net
-Status: Open +Status: Feedback
 [2010-04-22 12:45 UTC] degeberg@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

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] rasmus@php.net
This was fixed in svn a while ago.
 [2010-04-23 04:50 UTC] aharvey@php.net
-Status: Feedback +Status: Duplicate
 [2010-04-23 04:50 UTC] aharvey@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC