jay             Thu Sep 11 13:28:29 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src    NEWS 
    /php-src/ext/standard       array.c 
  Log:
  Fixed bug #25494 (array_merge allowing "false" as argument (silent when
  non-array is passed))
  # Now throws E_NOTICE for non-array args as per Ilia's suggestion.
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.390 php-src/NEWS:1.1247.2.391
--- php-src/NEWS:1.1247.2.390   Thu Sep 11 11:26:52 2003
+++ php-src/NEWS        Thu Sep 11 13:28:26 2003
@@ -7,6 +7,8 @@
 - Fixed crash bug when non-existing save/serializer handler was used. (Jani)
 - Fixed memory leak in gethostbynamel() if an error occurs. (Sara)
 - Fixed FastCGI being unable to bind to a specific IP. (Sascha)
+- Fixed bug #25494 (array_merge allowing "false" as argument (silent when 
+  non-array is passed)). (Jay)
 - Fixed bug #23488 (zlib.output_compression overrides Vary header). (Stefan)
 - Fixed bug #25463 (ext/cpdf: compile failure with bundled GD)
 - Fixed bug #25429 (fix copying of stdin using copy() function). (Ilia)
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.199.2.26 php-src/ext/standard/array.c:1.199.2.27
--- php-src/ext/standard/array.c:1.199.2.26     Tue Aug 12 21:37:58 2003
+++ php-src/ext/standard/array.c        Thu Sep 11 13:28:27 2003
@@ -22,7 +22,7 @@
 */
 
 
-/* $Id: array.c,v 1.199.2.26 2003/08/13 01:37:58 sniper Exp $ */
+/* $Id: array.c,v 1.199.2.27 2003/09/11 17:28:27 jay Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -2055,6 +2055,9 @@
        array_init(return_value);
        
        for (i=0; i<argc; i++) {
+               if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
+                       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Argument #%d is 
not an array", i+1);
+               }
                SEPARATE_ZVAL(args[i]);
                convert_to_array_ex(args[i]);
                php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(args[i]), 
recursive TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to