diff options
| author | Jay Smith <jay@php.net> | 2003-09-11 17:40:18 +0000 |
|---|---|---|
| committer | Jay Smith <jay@php.net> | 2003-09-11 17:40:18 +0000 |
| commit | 6c6fd76bac746e2eb6e75add4641c40e38ad84e9 (patch) | |
| tree | 1799c16c4d8d9ec1a31658b37b8842874e77b683 /ext/standard/array.c | |
| parent | 5bcc602a7c4cca0b3eda2fc9753275414bf5b1cb (diff) | |
| download | php-git-6c6fd76bac746e2eb6e75add4641c40e38ad84e9.tar.gz | |
Fixed bug #25494 (array_merge allowing "false" as argument (silent when
non-array is passed))
# 4.3 throws E_NOTICEs, 5 errors out on non-array args as per Ilia's
# suggestion.
Diffstat (limited to 'ext/standard/array.c')
| -rw-r--r-- | ext/standard/array.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 335b4d54a2..eae2cf6b90 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2209,7 +2209,15 @@ static void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMETERS, int recursive) efree(args); WRONG_PARAM_COUNT; } - + + for (i=0; i<argc; i++) { + if (Z_TYPE_PP(args[i]) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i+1); + efree(args); + return; + } + } + array_init(return_value); for (i=0; i<argc; i++) { |
