From: Marcus Boerger Date: Thu, 13 Nov 2003 07:53:15 +0000 (+0000) Subject: Pass eof X-Git-Tag: php-5.0.0b3RC1~701 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d752bd78eb30bc1dad0bbb41650cab2b67fbe7b;p=php Pass eof --- 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) {