From 8c634336f384fe3c599faacbacae44ff7e7cde90 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Thu, 25 Feb 2010 17:06:32 +0000 Subject: [PATCH] Added parameter parsing check to SimpleXMLElement::count() --- ext/simplexml/simplexml.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index fca160e3ff..f1843b497f 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1863,13 +1863,17 @@ static int sxe_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */ } /* }}} */ -/* {{{ proto int SimpleXMLIterator::count() +/* {{{ proto int SimpleXMLElement::count() Get number of child elements */ SXE_METHOD(count) { long count = 0; php_sxe_object *sxe = php_sxe_fetch_object(getThis() TSRMLS_CC); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + php_sxe_count_elements_helper(sxe, &count TSRMLS_CC); RETURN_LONG(count); -- 2.40.0