1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00

- Fix logic, it must check for both flags (as says the comment in the code) (bug #54912)

This commit is contained in:
Felipe Pena
2011-05-24 22:34:07 +00:00
parent bed49c931d
commit 6814cbec4b
+1 -1
View 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