]> granicus.if.org Git - php/commitdiff
Fixed bug #25494 (array_merge allowing "false" as argument (silent when
authorJay Smith <jay@php.net>
Thu, 11 Sep 2003 17:40:18 +0000 (17:40 +0000)
committerJay Smith <jay@php.net>
Thu, 11 Sep 2003 17:40:18 +0000 (17:40 +0000)
non-array is passed))
# 4.3 throws E_NOTICEs, 5 errors out on non-array args as per Ilia's
# suggestion.

ext/standard/array.c

index 335b4d54a272545735917cd5826679a078af2deb..eae2cf6b909bcbdeb21b3275b3cb20dea20f4ab4 100644 (file)
@@ -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++) {