Doc #77217 [Opn]: FILTER_FLAG_NO_RES_RANGE means Reserved-By-Protocol
Edit report at https://bugs.php.net/bug.php?id=77217&edit=1
ID: 77217
Updated by: requinix@php.net
Reported by: dan dot franklin at fen dot com
Summary: FILTER_FLAG_NO_RES_RANGE means Reserved-By-Protocol
Status: Open
Type: Documentation Problem
Package: Filter related
Operating System: Linux
PHP Version: 7.1.24
Block user comment: N
Private report: N
New Comment:
> 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".
Previous Comments:
------------------------------------------------------------------------
[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
Thread (5 messages)