Req #77221 [Opn]: Request IP address filter flag to exclude non-global IP addresses

From: Date: Tue, 10 Aug 2021 11:54:16 +0000
Subject: Req #77221 [Opn]: Request IP address filter flag to exclude non-global IP addresses
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235724@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77221&edit=1 ID: 77221 Updated by: cmb@php.net Reported by: dan dot franklin at fen dot com Summary: Request IP address filter flag to exclude non-global IP addresses Status: Open Type: Feature/Change Request -Package: filter +Package: Filter related Operating System: Linux PHP Version: Next Minor Version Block user comment: N Private report: N New Comment: Changing to "Filter related", since in practice that category is used for ext/filter. > Is someone working on this now, or can I make a PR on > https://github.com/php/php-src ? You're welcome to submit a pull request! Previous Comments: ------------------------------------------------------------------------ [2019-03-24 07:05:33] yutafuji2008 at gmail dot com 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 ? ------------------------------------------------------------------------ [2018-11-29 22:47:16] cmb@php.net Changing package to PECL/filter (“Filter related” is for stream filters). ------------------------------------------------------------------------ [2018-11-29 19:38:40] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77221&edit=1

« previous php.bugs (#235724) next »