diff options
Diffstat (limited to 'ext/spl/php_spl.c')
| -rwxr-xr-x | ext/spl/php_spl.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 58bf883f0..93194cd6e 100755 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_spl.c 300176 2010-06-04 00:10:15Z felipe $ */ +/* $Id: php_spl.c 305335 2010-11-14 18:40:08Z felipe $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -339,14 +339,13 @@ PHP_FUNCTION(spl_autoload) Register and return default file extensions for spl_autoload */ PHP_FUNCTION(spl_autoload_extensions) { - char *file_exts; + char *file_exts = NULL; int file_exts_len; - if (ZEND_NUM_ARGS() > 0) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file_exts, &file_exts_len) == FAILURE) { - return; - } - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &file_exts, &file_exts_len) == FAILURE) { + return; + } + if (file_exts) { if (SPL_G(autoload_extensions)) { efree(SPL_G(autoload_extensions)); } @@ -669,6 +668,10 @@ PHP_FUNCTION(spl_autoload_functions) HashPosition function_pos; autoload_func_info *alfi; + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (!EG(autoload_func)) { if (zend_hash_find(EG(function_table), ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME), (void **) &fptr) == SUCCESS) { array_init(return_value); |
