diff options
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r-- | ext/libxml/libxml.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index da30004f36..bfc1224eaa 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -951,9 +951,10 @@ static PHP_FUNCTION(libxml_set_streams_context) { zval *arg; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &arg) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_RESOURCE(arg) + ZEND_PARSE_PARAMETERS_END(); + if (!Z_ISUNDEF(LIBXML(stream_context))) { zval_ptr_dtor(&LIBXML(stream_context)); ZVAL_UNDEF(&LIBXML(stream_context)); @@ -969,9 +970,10 @@ static PHP_FUNCTION(libxml_use_internal_errors) xmlStructuredErrorFunc current_handler; zend_bool use_errors=0, retval; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &use_errors) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(use_errors) + ZEND_PARSE_PARAMETERS_END(); current_handler = xmlStructuredError; if (current_handler && current_handler == php_libxml_structured_error_handler) { @@ -1098,9 +1100,10 @@ static PHP_FUNCTION(libxml_disable_entity_loader) { zend_bool disable = 1; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &disable) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(disable) + ZEND_PARSE_PARAMETERS_END(); RETURN_BOOL(php_libxml_disable_entity_loader(disable)); } @@ -1112,10 +1115,10 @@ static PHP_FUNCTION(libxml_set_external_entity_loader) { zend_fcall_info fci; zend_fcall_info_cache fcc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!", &fci, &fcc) - == FAILURE) { - return; - } + + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_FUNC_EX(fci, fcc, 1, 0) + ZEND_PARSE_PARAMETERS_END(); _php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object); |