summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-02-23 16:52:29 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-02-23 16:52:29 +0000
commit0f3831a2f1aee0a5e4cb6444fab277695e5741c8 (patch)
tree215e61600476902421e5570d4e0e894771c7d7ff
parente85ec7c86465f2e7a3ba81c1c0834a8dda85f4a8 (diff)
downloadphp-git-0f3831a2f1aee0a5e4cb6444fab277695e5741c8.tar.gz
Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6
addresses in the filter extension)
-rw-r--r--ext/filter/logical_filters.c6
1 files changed, 6 insertions, 0 deletions
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;
}