From: Felipe Pena Date: Wed, 10 Jun 2009 19:01:17 +0000 (+0000) Subject: - MFH: Fix the fix (Bug #46973 - IPv6 address filter rejects valid address) X-Git-Tag: php-5.3.0RC4~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8da7275f1bc50d1eda5984bf386766b83461f3d7;p=php - MFH: Fix the fix (Bug #46973 - IPv6 address filter rejects valid address) --- diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 40011a9e21..a26bdaf5db 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -570,7 +570,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)