]> granicus.if.org Git - php/commitdiff
- Fix logic, it must check for both flags (as says the comment in the code) (bug...
authorFelipe Pena <felipe@php.net>
Tue, 24 May 2011 22:34:07 +0000 (22:34 +0000)
committerFelipe Pena <felipe@php.net>
Tue, 24 May 2011 22:34:07 +0000 (22:34 +0000)
ext/filter/logical_filters.c

index 8dc98fdd1ad54717573725233ed89e3d4c7c0672..d080d9ad2b92afe1701b66228f9b4da3849e1f4e 100644 (file)
@@ -682,7 +682,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
                RETURN_VALIDATION_FAILED
        }
 
-       if (flags & (FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
+       if ((flags & FILTER_FLAG_IPV4) && (flags & FILTER_FLAG_IPV6)) {
                /* Both formats are cool */
        } else if ((flags & FILTER_FLAG_IPV4) && mode == FORMAT_IPV6) {
                RETURN_VALIDATION_FAILED