]> granicus.if.org Git - php/commitdiff
- MFH: Fix the fix (Bug #46973 - IPv6 address filter rejects valid address)
authorFelipe Pena <felipe@php.net>
Wed, 10 Jun 2009 19:05:49 +0000 (19:05 +0000)
committerFelipe Pena <felipe@php.net>
Wed, 10 Jun 2009 19:05:49 +0000 (19:05 +0000)
ext/filter/logical_filters.c
ext/filter/tests/bug46973.phpt

index 40011a9e2122c55622a950d3ef87443795749f42..a26bdaf5db78e8e1d28a87d7fee9e76857958068 100644 (file)
@@ -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;
index c9c5ba4301ade0d9a1d8e6f253259b99f384f36e..01a5118cfc3308493e2809818f825c727a523211 100644 (file)
@@ -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)