diff options
| author | Felipe Pena <felipe@php.net> | 2010-11-14 18:40:08 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-11-14 18:40:08 +0000 |
| commit | 8192f0f771b28fade7d2b7b56dcab2c36a111f22 (patch) | |
| tree | ab9a62c28b9c7eb85629cb6821546c88719ffff7 /ext/spl/php_spl.c | |
| parent | 5f31c445095089154d32282a28c1b7920cac6579 (diff) | |
| download | php-git-8192f0f771b28fade7d2b7b56dcab2c36a111f22.tar.gz | |
- Added missing void arg checks
Diffstat (limited to 'ext/spl/php_spl.c')
| -rwxr-xr-x | ext/spl/php_spl.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index e7733c1e39..34f63fbcb1 100755 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -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)); } @@ -676,6 +675,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); |
