|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71368 FILTER_VALIDATE_URL rejects URLs starting with phar:///
Submitted: 2016-01-14 11:52 UTC Modified: -
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bschussek at gmail dot com Assigned:
Status: Open Package: Filter related
PHP Version: 7.0.2 OS: Ubuntu 14.04 LTS
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 - 30 = ?
Subscribe to this entry?

 [2016-01-14 11:52 UTC] bschussek at gmail dot com
FILTER_VALIDATE_URLS rejects URLs starting with "phar:///".

Test script:

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"


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Oct 19 10:01:26 2019 UTC