> Ramus, > > On Tue, Apr 6, 2010 at 1:34 PM, Rasmus Lerdorf <ras...@lerdorf.com> wrote: > >> >> Here is a straightforward (but not easy) one: >> >> http://bugs.php.net/bug.php?id=47435 >> >> I actually found it easy, slightly tedious, and not straightforward. I > guess its perspective. > > I am CCing my former colleague Mike G who added is $.02 to the ticket at > my > request.
> Valli's notes implied that FILTER_VALIDATE_IP should match CIDR netmask > notations. eg 0.0.0.0/0 and ::1/128 should match. They do not. I propose a > new flag called FILTER_FLAG_INCLUDE_CIDR_NETMASK that does match. I have mixed feelings on the CIDR matching aspect -- using CIDR notation It's possible to define an "insane" network (like 8000::/1 or 128.0.0.0/1 or 192.0.0.0/8) that encompasses a bunch of "special" nets, but is not itself "special" per the RFCs. It's a stupid and pathological edge case which should never happen, but it creates all sorts of funky interaction with the other filter flags that you would need to account for. Rejecting the CIDR mask and requiring an unqualified (and therefore implied v4/32 or v6/128) address is a neat (and common) way of sidestepping that problem. Having said that, in the sane, non-pathological case subnet matching is really nice to have. :) -MG -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php