php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77221 Request IP address filter flag to exclude non-global IP addresses
Submitted: 2018-11-29 19:38 UTC Modified: 2018-11-29 22:47 UTC
From: dan dot franklin at fen dot com Assigned:
Status: Open Package: filter (PECL)
PHP Version: Next Minor Version OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-11-29 19:38 UTC] dan dot franklin at fen dot com
Description:
------------
Currently, filter_var is able to filter out private IP addresses and those reserved by protocol with the FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE flags respectively.

There is a need for further filtering, to determine whether an IP address is Global, as described in RFC 6890.

Only global addresses are useful in identifying the country of origin; this new filter would enable PHP code to search through the list of addresses in an X-Forwarded-For header to find the first global address and send only that address to a country locator such as GeoIP.

Global addresses would also be useful for forensic purposes.

This request is for a new flag, perhaps called FILTER_FLAG_ONLY_GLOBAL_RANGE, that would filter out all IP address ranges listed as “Global: false” in RFC 6890.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-29 22:47 UTC] cmb@php.net
-Package: Network related +Package: filter
 [2018-11-29 22:47 UTC] cmb@php.net
Changing package to PECL/filter (“Filter related” is for stream filters).
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 10 09:01:25 2018 UTC