Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
* PHP-8.2:
  Fix libxml2 2.12 build due to API breaks
  • Loading branch information
nielsdos committed Dec 1, 2023
2 parents b175ea4 + 0a39890 commit f61f8d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions ext/libxml/libxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,11 @@ static void _php_libxml_free_error(void *ptr)
xmlResetError((xmlErrorPtr) ptr);
}

static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
#if LIBXML_VERSION >= 21200
static void _php_list_set_error_structure(const xmlError *error, const char *msg)
#else
static void _php_list_set_error_structure(xmlError *error, const char *msg)
#endif
{
xmlError error_copy;
int ret;
Expand Down Expand Up @@ -839,7 +843,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
va_end(args);
}

static void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
#if LIBXML_VERSION >= 21200
void php_libxml_structured_error_handler(void *userData, const xmlError *error)
#else
void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
#endif
{
_php_list_set_error_structure(error, NULL);

Expand Down Expand Up @@ -1071,11 +1079,9 @@ PHP_FUNCTION(libxml_use_internal_errors)
/* {{{ Retrieve last error from libxml */
PHP_FUNCTION(libxml_get_last_error)
{
xmlErrorPtr error;

ZEND_PARSE_PARAMETERS_NONE();

error = xmlGetLastError();
const xmlError *error = xmlGetLastError();

if (error) {
object_init_ex(return_value, libxmlerror_class_entry);
Expand Down
2 changes: 1 addition & 1 deletion ext/soap/php_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
sdl_restore_uri_credentials(ctx);

if (!wsdl) {
xmlErrorPtr xmlErrorPtr = xmlGetLastError();
const xmlError *xmlErrorPtr = xmlGetLastError();

if (xmlErrorPtr) {
soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from '%s' : %s", struri, xmlErrorPtr->message);
Expand Down

0 comments on commit f61f8d4

Please sign in to comment.