summaryrefslogtreecommitdiff
path: root/ext/libxml/libxml.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r--ext/libxml/libxml.c42
1 files changed, 13 insertions, 29 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index efccf0a407..9c6a51f5f8 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
@@ -43,6 +41,7 @@
#endif
#include "php_libxml.h"
+#include "libxml_arginfo.h"
#define PHP_LIBXML_ERROR 0
#define PHP_LIBXML_CTX_ERROR 1
@@ -91,33 +90,6 @@ static int php_libxml_post_deactivate(void);
/* }}} */
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO(arginfo_libxml_set_streams_context, 0)
- ZEND_ARG_INFO(0, context)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_use_internal_errors, 0, 0, 0)
- ZEND_ARG_INFO(0, use_errors)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_libxml_get_last_error, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_libxml_get_errors, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_libxml_clear_errors, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_disable_entity_loader, 0, 0, 0)
- ZEND_ARG_INFO(0, disable)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_libxml_set_external_entity_loader, 0, 0, 1)
- ZEND_ARG_INFO(0, resolver_function)
-ZEND_END_ARG_INFO()
-/* }}} */
-
/* {{{ extension definition structures */
static const zend_function_entry libxml_functions[] = {
PHP_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context)
@@ -1003,6 +975,10 @@ static PHP_FUNCTION(libxml_get_last_error)
{
xmlErrorPtr error;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
error = xmlGetLastError();
if (error) {
@@ -1034,6 +1010,10 @@ static PHP_FUNCTION(libxml_get_errors)
xmlErrorPtr error;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
if (LIBXML(error_list)) {
array_init(return_value);
@@ -1071,6 +1051,10 @@ static PHP_FUNCTION(libxml_get_errors)
Clear last error from libxml */
static PHP_FUNCTION(libxml_clear_errors)
{
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
xmlResetLastError();
if (LIBXML(error_list)) {
zend_llist_clean(LIBXML(error_list));