php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #71576 FILTER_VALIDATE_URL uses an obsolete URI RFC
Submitted: 2016-02-12 15:33 UTC Modified: -
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: apokryfos84 at gmail dot com Assigned:
Status: Open Package: Filter related
PHP Version: 5.6.18 OS: Linux
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: apokryfos84 at gmail dot com
New email:
PHP Version: OS:

 

 [2016-02-12 15:33 UTC] apokryfos84 at gmail dot com
Description:
------------
According to http://php.net/manual/en/filter.filters.validate.php

"Validates value as URL (according to ยป http://www.faqs.org/rfcs/rfc2396)"

However RFC 2396 has been made obsolete by RFC 3986. This results in several valid RFC 3986 URIs to not validate correctly, (e.g. protocol agnostic URLs). 



Test script:
---------------
echo filter_var("https://example.com/path/to/resource?query=param",FILTER_VALIDATE_URL)?"yes":"no";
// Echoes yes

echo filter_var("//example.com/path/to/resource?query=param",FILTER_VALIDATE_URL)?"yes":"no";
// Echoes no but should echo yes as per section 4.2 of RFC 3986



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC