MFB: Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6

addresses in the filter extension)
This commit is contained in:
Ilia Alshanetsky 2009-02-23 16:52:45 +00:00
parent 2416c93505
commit ed863d64e8

View File

@ -659,6 +659,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;
}