From: Felipe Pena Date: Tue, 24 May 2011 22:34:07 +0000 (+0000) Subject: - Fix logic, it must check for both flags (as says the comment in the code) (bug... X-Git-Tag: php-5.3.7RC1~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6814cbec4bdf13caede74085cd9fe3c44c8dba0e;p=php - Fix logic, it must check for both flags (as says the comment in the code) (bug #54912) --- diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 8dc98fdd1a..d080d9ad2b 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -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