1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

libxml: Fix input buffer deprecation

While this fixed the last deprecation in ext/libxml, it's not a full
fix: The full fix would be to move to the context-specific APIs to
override the behaviour. However, that requires API/ABI incompatible
changes so that can't be done on a stable branch.

Closes GH-20525.
This commit is contained in:
Niels Dossche
2025-11-18 20:29:15 +01:00
parent 2f05830a5f
commit 8c2407714f

View File

@@ -513,6 +513,7 @@ static int php_libxml_streams_IO_close(void *context)
return php_stream_close((php_stream*)context);
}
/* TODO: This needs to be replaced by context-specific APIs in the future! */
static xmlParserInputBufferPtr
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
{
@@ -591,13 +592,10 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
}
/* Allocate the Input buffer front-end. */
ret = xmlAllocParserInputBuffer(enc);
if (ret != NULL) {
ret->context = context;
ret->readcallback = php_libxml_streams_IO_read;
ret->closecallback = php_libxml_streams_IO_close;
} else
ret = xmlParserInputBufferCreateIO(php_libxml_streams_IO_read, php_libxml_streams_IO_close, context, enc);
if (ret == NULL) {
php_libxml_streams_IO_close(context);
}
return(ret);
}