From c3b2427610ce3b0ac9b55e1e44c0f381db93ed30 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 10 Jun 2009 19:00:54 +0000 Subject: [PATCH] - Fix the fix (Bug #46973 - IPv6 address filter rejects valid address) --- ext/filter/logical_filters.c | 2 +- ext/filter/tests/bug46973.phpt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 58eef8e8c8..c7899ca96d 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -574,7 +574,7 @@ static int _php_filter_validate_ipv6(char *str, int str_len TSRMLS_DC) /* {{{ */ } if (*str == ':') { if (compressed || --blocks == 0) { - return ipv4 != NULL; + return 0; } if (++str == end || (ipv4 && ipv4 == str)) { return 1; diff --git a/ext/filter/tests/bug46973.phpt b/ext/filter/tests/bug46973.phpt index c9c5ba4301..01a5118cfc 100644 --- a/ext/filter/tests/bug46973.phpt +++ b/ext/filter/tests/bug46973.phpt @@ -9,6 +9,6 @@ var_dump(filter_var('1fff::a88:85a3::172.31.128.1', FILTER_VALIDATE_IP,FILTER_FL ?> --EXPECTF-- -string(28) "1fff::a88:85a3::172.31.128.1" +bool(false) string(39) "3ffe:6a88:85a3:08d3:1319:8a2e:0370:7344" -string(28) "1fff::a88:85a3::172.31.128.1" +bool(false) -- 2.50.1