felipe          Fri Feb 22 13:28:40 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/standard       array.c 
  Log:
  Fixed Bug #44212 (array_diff_assoc not reporting missing arguments)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.25&r2=1.308.2.21.2.37.2.26&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.25 
php-src/ext/standard/array.c:1.308.2.21.2.37.2.26
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.25   Fri Feb 15 09:33:09 2008
+++ php-src/ext/standard/array.c        Fri Feb 22 13:28:40 2008
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37.2.25 2008/02/15 09:33:09 tony2001 Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.26 2008/02/22 13:28:40 felipe Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -3211,12 +3211,20 @@
        /* Get the argument count */
        argc = ZEND_NUM_ARGS();
        if (data_compare_type == DIFF_COMP_DATA_USER) {
-               if (argc < 3 || zend_parse_parameters(ZEND_NUM_ARGS() 
TSRMLS_CC, "+f", &args, &argc, &BG(user_compare_fci), 
&BG(user_compare_fci_cache)) == FAILURE) {
+               if (argc < 3) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 3 
parameters are required, %d given", ZEND_NUM_ARGS());
+                       return;
+               }
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+f", 
&args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) {
                        return;
                }
                diff_data_compare_func = zval_user_compare;
        } else {
-               if (argc < 2 || zend_parse_parameters(ZEND_NUM_ARGS() 
TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+               if (argc < 2) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "at least 2 
parameters are required, %d given", ZEND_NUM_ARGS());
+                       return;
+               }
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", 
&args, &argc) == FAILURE) {
                        return;
                }
                if (data_compare_type == DIFF_COMP_DATA_INTERNAL) {

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

Reply via email to