jani            Wed Aug  6 04:48:40 2008 UTC

  Modified files:              
    /php-src/ext/session        session.c 
  Log:
  - MFB: sync parameter parsing API changes in session_set_save_handler()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/session/session.c?r1=1.490&r2=1.491&diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.490 php-src/ext/session/session.c:1.491
--- php-src/ext/session/session.c:1.490 Wed Aug  6 04:24:55 2008
+++ php-src/ext/session/session.c       Wed Aug  6 04:48:39 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: session.c,v 1.490 2008/08/06 04:24:55 jani Exp $ */
+/* $Id: session.c,v 1.491 2008/08/06 04:48:39 jani Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1503,21 +1503,25 @@
    Sets user-level functions */
 static PHP_FUNCTION(session_set_save_handler)
 {
-       zval **args[6];
-       int i;
+       zval ***args = NULL;
+       int i, num_args, argc = ZEND_NUM_ARGS();
        zval name;
 
        if (PS(session_status) != php_session_none) {
                RETURN_FALSE;
        }
 
-       if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_array_ex(6, args) == 
FAILURE) {
+       if (argc != 6) {
                WRONG_PARAM_COUNT;
        }
 
+       if (zend_parse_parameters(argc TSRMLS_CC, "+", &args, &num_args) == 
FAILURE) {
+               return;
+       }
 
        for (i = 0; i < 6; i++) {
                if (!zend_is_callable(*args[i], 0, &name TSRMLS_CC)) {
+                       efree(args);
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument 
%d is not a valid callback", i+1);
                        zval_dtor(&name);
                        RETURN_FALSE;
@@ -1531,10 +1535,11 @@
                if (PS(mod_user_names).names[i] != NULL) {
                        zval_ptr_dtor(&PS(mod_user_names).names[i]);
                }
-               Z_ADDREF_P(*args[i]);
+               Z_ADDREF_PP(args[i]);
                PS(mod_user_names).names[i] = *args[i];
        }
 
+       efree(args);
        RETURN_TRUE;
 }
 /* }}} */



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

Reply via email to