]> granicus.if.org Git - php/commitdiff
Added parameter parsing check to SimpleXMLElement::count()
authorKalle Sommer Nielsen <kalle@php.net>
Thu, 25 Feb 2010 17:06:32 +0000 (17:06 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Thu, 25 Feb 2010 17:06:32 +0000 (17:06 +0000)
ext/simplexml/simplexml.c

index a2f8e97665548de0accab70f0e5112a66adf13ba..102f8f9371c0535659f842068909a7a13b700228 100644 (file)
@@ -1908,13 +1908,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);