|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55800 FILTER_VALIDATE_URL validates wrong
Submitted: 2011-09-27 13:28 UTC Modified: 2011-09-27 22:13 UTC
From: giuseppem at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: Irrelevant OS: Ubuntu 11.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: giuseppem at gmail dot com
New email:
PHP Version: OS:


 [2011-09-27 13:28 UTC] giuseppem at gmail dot com
From manual page:

FILTER_VALIDATE_URL validates wrong when you set two or more urls together, for 

$url = '';

I'm using PHP version 5.3.5

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

Expected result:

Actual result:
string(35) ""


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-27 17:44 UTC]
-Status: Open +Status: Bogus
 [2011-09-27 17:44 UTC]
That's a valid URL: in this case, the path component is, and 
that's explicitly allowed by RFC 3986 -- path components can include colons.
 [2011-09-27 22:13 UTC] giuseppem at gmail dot com
Oh. I was thinking that was <scheme>://<authority>/<scheme>://<authority> and not 
the path. Now it's clear, thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun May 22 20:05:44 2022 UTC