diff options
| author | Felipe Pena <felipe@php.net> | 2009-06-10 19:01:17 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2009-06-10 19:01:17 +0000 |
| commit | 8da7275f1bc50d1eda5984bf386766b83461f3d7 (patch) | |
| tree | 80e02b4fccf1d58c571ef5f745d929d714d9abd7 | |
| parent | a8f3eeefe8ba6bf463a5eca17f614dd2bac87169 (diff) | |
| download | php-git-8da7275f1bc50d1eda5984bf386766b83461f3d7.tar.gz | |
- MFH: Fix the fix (Bug #46973 - IPv6 address filter rejects valid address)
| -rw-r--r-- | ext/filter/logical_filters.c | 2 | ||||
| -rw-r--r-- | 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 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) |
