From: Jeff Welch Date: Sun, 8 Mar 2015 15:31:26 +0000 (-0400) Subject: Adjust logic in sanity checks. X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~752^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1dc5bd47d8707ba805927681bc878087d6b9b5fa;p=php Adjust logic in sanity checks. The code should return false when the provided options argument is neither an array nor a valid filter. --- diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 107ba86374..475cfccb2e 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -800,7 +800,7 @@ PHP_FUNCTION(filter_input_array) return; } - if (op && (Z_TYPE_P(op) != IS_ARRAY) && (Z_TYPE_P(op) == IS_LONG && !PHP_FILTER_ID_EXISTS(Z_LVAL_P(op)))) { + if (op && (Z_TYPE_P(op) != IS_ARRAY) && !(Z_TYPE_P(op) == IS_LONG && PHP_FILTER_ID_EXISTS(Z_LVAL_P(op)))) { RETURN_FALSE; } @@ -845,7 +845,7 @@ PHP_FUNCTION(filter_var_array) return; } - if (op && (Z_TYPE_P(op) != IS_ARRAY) && (Z_TYPE_P(op) == IS_LONG && !PHP_FILTER_ID_EXISTS(Z_LVAL_P(op)))) { + if (op && (Z_TYPE_P(op) != IS_ARRAY) && !(Z_TYPE_P(op) == IS_LONG && PHP_FILTER_ID_EXISTS(Z_LVAL_P(op)))) { RETURN_FALSE; } diff --git a/ext/filter/tests/057.phpt b/ext/filter/tests/057.phpt new file mode 100644 index 0000000000..93ab3eed36 --- /dev/null +++ b/ext/filter/tests/057.phpt @@ -0,0 +1,23 @@ +--TEST-- +filter_input_array() and filter_var_array() with invalid $definition arguments +--SKIPIF-- + +--FILE-- +