go to bug id or search bugs for
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.
Add a Patch
Add a Pull Request
Changing package to PECL/filter (“Filter related” is for stream filters).
Hi, I read https://bugs.php.net/bug.php?id=77217 and came to this page.
I totally agree with what dan dot franklin says and want this flag, too!
Is someone working on this now, or can I make a PR on https://github.com/php/php-src ?