mirror of
https://github.com/php/php-src.git
synced 2025-01-10 13:03:54 +08:00
MFB: Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6
addresses in the filter extension)
This commit is contained in:
parent
2416c93505
commit
ed863d64e8
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user