]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6
authorIlia Alshanetsky <iliaa@php.net>
Sun, 1 Mar 2009 17:36:09 +0000 (17:36 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 1 Mar 2009 17:36:09 +0000 (17:36 +0000)
addresses in the filter extension)

NEWS
ext/filter/logical_filters.c

diff --git a/NEWS b/NEWS
index eeb3fddd7979f03d39ef4c965a9fa7c5a4c4511d..013c32d0cf2abc34fb7dd2d49e732afad46db182 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ PHP                                                                        NEWS
 ?? ??? 2009, PHP 5.2.10
 - Fixed memory corruptions while reading properties of zip files. (Ilia)
 
+- Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6
+ addresses in the filter extension). (Ilia)
+
 26 Feb 2009, PHP 5.2.9
 - Changed __call() to be invoked on private/protected method access, similar to
   properties and __get(). (Andrei)
index 2df6265df2595a741c5dade6e684b8019dd1d639..6074af0e2088dc75ea0f2608e5502c474274286d 100644 (file)
@@ -655,6 +655,12 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
                                if (res < 1) {
                                        RETURN_VALIDATION_FAILED
                                }
+                               /* Check flags */
+                               if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
+                                       if (Z_STRLEN_P(value) >=2 && (!strncasecmp("FC", Z_STRVAL_P(value), 2) || !strncasecmp("FD", Z_STRVAL_P(value), 2))) {
+                                               RETURN_VALIDATION_FAILED
+                                       }
+                               }
                        }
                        break;
        }