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

From: Date: Thu, 06 Jan 2022 10:23:03 +0000
Subject: Req #77221 [PATCH]: 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-238791@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 Patch added by: vnsavage@gmail.com 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 related Operating System: Linux PHP Version: Next Minor Version Block user comment: N Private report: N New Comment: The following pull request has been associated: Patch Name: Implement a filter that filters for Global IPs as per RFC 6890 On GitHub: https://github.com/php/php-src/pull/7893 Patch: https://github.com/php/php-src/pull/7893.patch Previous Comments: ------------------------------------------------------------------------ [2021-08-10 11:54:16] cmb@php.net 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! ------------------------------------------------------------------------ [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 (#238791) next »