diff options
| author | Marcus Boerger <helly@php.net> | 2003-11-13 07:53:15 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-11-13 07:53:15 +0000 |
| commit | 4d752bd78eb30bc1dad0bbb41650cab2b67fbe7b (patch) | |
| tree | 884bf317ffd0430139ec0f5e7c9877855fbcc03c /ext/dba/dba.c | |
| parent | db2a1f4590ca95f2f7268429121783ce75f7dec6 (diff) | |
| download | php-git-4d752bd78eb30bc1dad0bbb41650cab2b67fbe7b.tar.gz | |
Pass eof
Diffstat (limited to 'ext/dba/dba.c')
| -rw-r--r-- | ext/dba/dba.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 31ce4827ef..44deb75af8 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -911,15 +911,24 @@ PHP_FUNCTION(dba_fetch) } /* }}} */ -/* {{{ proto array dba_key_split(string key) - Splits an inifile key into an array of the form array(0=>group,1=>value_name) */ +/* {{{ proto array|false dba_key_split(string key) + Splits an inifile key into an array of the form array(0=>group,1=>value_name) but returns false if input is false or null */ PHP_FUNCTION(dba_key_split) { + zval *zkey; char *key, *name; int key_len; - + + if (ZEND_NUM_ARGS() != 1) { + WRONG_PARAM_COUNT; + } + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) { + if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_BOOL && !Z_LVAL_P(zkey))) { + RETURN_BOOL(0); + } + } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { - return; + RETURN_BOOL(0); } array_init(return_value); if (key[0] == '[' && (name = strchr(key, ']')) != NULL) { |
