From: Ilia Alshanetsky Date: Sun, 1 Mar 2009 17:36:09 +0000 (+0000) Subject: MFB: Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6 X-Git-Tag: php-5.2.10RC1~312 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=536ed996a02af94a92388614ccf543eaea799952;p=php MFB: Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6 addresses in the filter extension) --- diff --git a/NEWS b/NEWS index eeb3fddd79..013c32d0cf 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,9 @@ PHP NEWS ?? ??? 2009, PHP 5.2.10 - Fixed memory corruptions while reading properties of zip files. (Ilia) +- Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6 + addresses in the filter extension). (Ilia) + 26 Feb 2009, PHP 5.2.9 - Changed __call() to be invoked on private/protected method access, similar to properties and __get(). (Andrei) diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 2df6265df2..6074af0e20 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -655,6 +655,12 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (res < 1) { RETURN_VALIDATION_FAILED } + /* Check flags */ + if (flags & FILTER_FLAG_NO_PRIV_RANGE) { + if (Z_STRLEN_P(value) >=2 && (!strncasecmp("FC", Z_STRVAL_P(value), 2) || !strncasecmp("FD", Z_STRVAL_P(value), 2))) { + RETURN_VALIDATION_FAILED + } + } } break; }