summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2003-09-22 23:19:17 +0000
committerAndrey Hristov <andrey@php.net>2003-09-22 23:19:17 +0000
commit63d7df3e2f37fa3e0acb1949f7151acfaf07e3da (patch)
treedbe49ae5cfd5bcd508043b71b2366f6ec5dc5739 /ext
parentcb4db3203026681bb97990fc330eb35aa86a8789 (diff)
downloadphp-git-63d7df3e2f37fa3e0acb1949f7151acfaf07e3da.tar.gz
improve the fix for #25494. If more then one bad parameter is passed
an warning for all will be emitted.
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/array.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index eae2cf6b90..dd160964eb 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2195,7 +2195,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src, int recursive TSRMLS
static void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMETERS, int recursive)
{
zval ***args = NULL;
- int argc, i;
+ int argc, i, params_ok = 1;
/* Get the argument count and check it */
argc = ZEND_NUM_ARGS();
@@ -2210,13 +2210,16 @@ static void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMETERS, int recursive)
WRONG_PARAM_COUNT;
}
- for (i=0; i<argc; i++) {
+ 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;
+ params_ok = 0;
}
}
+ if (params_ok == 0) {
+ efree(args);
+ return;
+ }
array_init(return_value);