summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/array.c10
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++) {