Bug #55800 [Bgs]: FILTER_VALIDATE_URL validates wrong
| From: | giuseppem at gmail dot com | Date: | Tue, 27 Sep 2011 22:13:08 +0000 |
| Subject: | Bug #55800 [Bgs]: FILTER_VALIDATE_URL validates wrong | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163930@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55800&edit=1
ID: 55800
User updated by: giuseppem at gmail dot com
Reported by: giuseppem at gmail dot com
Summary: FILTER_VALIDATE_URL validates wrong
Status: Bogus
Type: Bug
Package: Filter related
Operating System: Ubuntu 11.04
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Oh. I was thinking that was <scheme>://<authority>/<scheme>://<authority>
and not
the path. Now it's clear, thank you.
Previous Comments:
------------------------------------------------------------------------
[2011-09-27 17:44:11] aharvey@php.net
That's a valid URL: in this case, the path component is http://bugs.php.net/, and
that's explicitly allowed by RFC 3986 -- path components can include colons.
------------------------------------------------------------------------
[2011-09-27 13:28:32] giuseppem at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.filter-var
---
FILTER_VALIDATE_URL validates wrong when you set two or more urls together, for
example:
$url = 'http://php.net/http://bugs.php.net/';
I'm using PHP version 5.3.5
Test script:
---------------
<?php
$url = 'http://php.net/http://bugs.php.net/';
var_dump(filter_var($url, FILTER_VALIDATE_URL));
?>
Expected result:
----------------
bool(false)
Actual result:
--------------
string(35) "http://php.net/http://bugs.php.net/"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55800&edit=1