Bug #71368 [Opn]: FILTER_VALIDATE_URL rejects URLs starting with phar:///
| From: | cmb@php.net | Date: | Wed, 15 Apr 2020 16:42:21 +0000 |
| Subject: | Bug #71368 [Opn]: FILTER_VALIDATE_URL rejects URLs starting with phar:/// | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226593@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71368&edit=1
ID: 71368
Updated by: cmb@php.net
Reported by: bschussek at gmail dot com
Summary: FILTER_VALIDATE_URL rejects URLs starting with
phar:///
Status: Open
Type: Bug
Package: Filter related
Operating System: Ubuntu 14.04 LTS
PHP Version: 7.0.2
Block user comment: N
Private report: N
New Comment:
This is because these URLs are rejected by parse_url()[1].
[1] <https://3v4l.org/uaF2G>
Previous Comments:
------------------------------------------------------------------------
[2016-01-14 11:52:01] bschussek at gmail dot com
Description:
------------
FILTER_VALIDATE_URLS rejects URLs starting with "phar:///".
Test script:
---------------
<?php
var_dump(filter_var('file://c:/path/to/dir', FILTER_VALIDATE_URL));
var_dump(filter_var('file:///path/to/dir', FILTER_VALIDATE_URL));
var_dump(filter_var('phar://c:/path/to/dir', FILTER_VALIDATE_URL));
var_dump(filter_var('phar:///path/to/dir', FILTER_VALIDATE_URL));
Expected result:
----------------
string(21) "file://c:/path/to/dir"
string(19) "file:///path/to/dir"
string(21) "phar://c:/path/to/dir"
string(19) "phar:///path/to/dir"
Actual result:
--------------
string(21) "file://c:/path/to/dir"
string(19) "file:///path/to/dir"
string(21) "phar://c:/path/to/dir"
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71368&edit=1