summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@lerdorf.com>2013-10-19 00:01:13 -0700
committerRasmus Lerdorf <rasmus@lerdorf.com>2013-10-19 00:43:21 -0700
commit55b16f40a2db6de9f5de08d284b1c37149e25a49 (patch)
tree4435541fd057de9770654d9a0b023bf8fb709eb9 /ext
parent30d64b0efbc0e49a058858fe8096dcb70455ddd4 (diff)
downloadphp-git-55b16f40a2db6de9f5de08d284b1c37149e25a49.tar.gz
Merge branch 'pull-request/499'
Fix RFC 6598 IPv4 Reserved Range Checks
Diffstat (limited to 'ext')
-rw-r--r--ext/filter/logical_filters.c2
-rw-r--r--ext/filter/tests/018.phpt2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 653cce23e6..39433d6ece 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -714,7 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (flags & FILTER_FLAG_NO_RES_RANGE) {
if (
(ip[0] == 0) ||
- (ip[0] == 100 && (ip[1] >= 64 || ip[1] <= 127)) ||
+ (ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
(ip[0] == 128 && ip[1] == 0) ||
(ip[0] == 191 && ip[1] == 255) ||
(ip[0] == 169 && ip[1] == 254) ||
diff --git a/ext/filter/tests/018.phpt b/ext/filter/tests/018.phpt
index 9c73fc3cfc..75bbd13427 100644
--- a/ext/filter/tests/018.phpt
+++ b/ext/filter/tests/018.phpt
@@ -15,7 +15,7 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE));
var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
-var_dump(filter_var("100.0.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
+var_dump(filter_var("100.64.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP));
var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP));