andrey Mon Sep 22 19:19:19 2003 EDT
Modified files:
/php-src/ext/standard array.c
Log:
improve the fix for #25494. If more then one bad parameter is passed
an warning for all will be emitted.
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.245 php-src/ext/standard/array.c:1.246
--- php-src/ext/standard/array.c:1.245 Thu Sep 11 13:40:18 2003
+++ php-src/ext/standard/array.c Mon Sep 22 19:19:17 2003
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.245 2003/09/11 17:40:18 jay Exp $ */
+/* $Id: array.c,v 1.246 2003/09/22 23:19:17 andrey Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -2195,7 +2195,7 @@
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,12 +2210,15 @@
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);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php