Skip to content

Commit f61f8d4

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix libxml2 2.12 build due to API breaks
2 parents b175ea4 + 0a39890 commit f61f8d4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

ext/libxml/libxml.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,11 @@ static void _php_libxml_free_error(void *ptr)
608608
xmlResetError((xmlErrorPtr) ptr);
609609
}
610610

611-
static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
611+
#if LIBXML_VERSION >= 21200
612+
static void _php_list_set_error_structure(const xmlError *error, const char *msg)
613+
#else
614+
static void _php_list_set_error_structure(xmlError *error, const char *msg)
615+
#endif
612616
{
613617
xmlError error_copy;
614618
int ret;
@@ -839,7 +843,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
839843
va_end(args);
840844
}
841845

842-
static void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
846+
#if LIBXML_VERSION >= 21200
847+
void php_libxml_structured_error_handler(void *userData, const xmlError *error)
848+
#else
849+
void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
850+
#endif
843851
{
844852
_php_list_set_error_structure(error, NULL);
845853

@@ -1071,11 +1079,9 @@ PHP_FUNCTION(libxml_use_internal_errors)
10711079
/* {{{ Retrieve last error from libxml */
10721080
PHP_FUNCTION(libxml_get_last_error)
10731081
{
1074-
xmlErrorPtr error;
1075-
10761082
ZEND_PARSE_PARAMETERS_NONE();
10771083

1078-
error = xmlGetLastError();
1084+
const xmlError *error = xmlGetLastError();
10791085

10801086
if (error) {
10811087
object_init_ex(return_value, libxmlerror_class_entry);

ext/soap/php_sdl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, sdlCtx *ctx, int include)
332332
sdl_restore_uri_credentials(ctx);
333333

334334
if (!wsdl) {
335-
xmlErrorPtr xmlErrorPtr = xmlGetLastError();
335+
const xmlError *xmlErrorPtr = xmlGetLastError();
336336

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

0 commit comments

Comments
 (0)