Doc #77217 [Opn->Csd]: FILTER_FLAG_NO_RES_RANGE means Reserved-By-Protocol

From: Date: Thu, 05 Aug 2021 17:03:31 +0000
Subject: Doc #77217 [Opn->Csd]: FILTER_FLAG_NO_RES_RANGE means Reserved-By-Protocol
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-19043@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77217&edit=1 ID: 77217 Updated by: git@php.net Reported by: dan dot franklin at fen dot com Summary: FILTER_FLAG_NO_RES_RANGE means Reserved-By-Protocol -Status: Open +Status: Closed Type: Documentation Problem Package: Filter related Operating System: Linux PHP Version: 7.1.24 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmb69 Revision: https://github.com/php/doc-en/commit/3d85246557ce5d38c036c019011f6427e61b7041 Log: Fix #77217: FILTER_FLAG_NO_RES_RANGE means Reserved-By-Protocol Previous Comments: ------------------------------------------------------------------------ [2018-11-29 19:41:33] dan dot franklin at fen dot com Thanks, I've submitted a feature request. https://bugs.php.net/bug.php?id=77221&thanks=4 I would expect a flag NO_GLOBAL_RANGE to _exclude_ global addresses, as NO_RES_RANGE excludes reserved addresses and NO_PRIV_RANGE excludes private addresses. I suggested FILTER_FLAG_ONLY_GLOBAL_RANGE in my feature request. ------------------------------------------------------------------------ [2018-11-29 17:07:05] requinix@php.net > Seems like there needs to be a new flag FILTER_FLAG_GLOBAL_RANGE Sounds reasonable. Please create a feature request for it so this bug report can be about fixing the documentation for FILTER_FLAG_NO_RES_RANGE. Though maybe it should be "FILTER_FLAG_NO_GLOBAL_RANGE". ------------------------------------------------------------------------ [2018-11-29 14:34:52] dan dot franklin at fen dot com Thanks for the explanation. Unfortunately this means that the two current IP validation flags don't meet my needs. Seems like there needs to be a new flag FILTER_FLAG_GLOBAL_RANGE which rejects IP addresses that are marked as "Global: false" in RFC 6890 (amended to "Global Reach" in RFC 8190). ------------------------------------------------------------------------ [2018-11-29 02:41:26] requinix@php.net FILTER_FLAG_NO_RES_RANGE refers specifically to ranges marked as Reserved-By-Protocol in RFC 6890, which covers the addresses mentioned in the documentation. What Wikipedia labels as "reserved" is really more about the range having a special meaning. If anything, 100./10 would be part of the the PRIV_RANGE, except the range isn't entirely private. Debatable. ------------------------------------------------------------------------ [2018-11-29 02:25:34] dan dot franklin at fen dot com Description: ------------ According to https://en.wikipedia.org/wiki/Reserved_IP_addresses the IPv4 address range 100.64.0.0/10 is reserved for carrier-grade NAT. But in PHP 7.1.24 filter_var with FILTER_FLAG_NO_RES_RANGE thinks it's fine. Test script: --------------- <?php var_export(filter_var('100.74.11.184', FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE)); Expected result: ---------------- false Actual result: -------------- '100.74.11.184' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77217&edit=1

« previous php.doc.bugs (#19043) next »