Skip to content

Commit 8c24077

Browse files
committed
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.
1 parent 2f05830 commit 8c24077

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ext/libxml/libxml.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ static int php_libxml_streams_IO_close(void *context)
513513
return php_stream_close((php_stream*)context);
514514
}
515515

516+
/* TODO: This needs to be replaced by context-specific APIs in the future! */
516517
static xmlParserInputBufferPtr
517518
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
518519
{
@@ -591,13 +592,10 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
591592
}
592593

593594
/* Allocate the Input buffer front-end. */
594-
ret = xmlAllocParserInputBuffer(enc);
595-
if (ret != NULL) {
596-
ret->context = context;
597-
ret->readcallback = php_libxml_streams_IO_read;
598-
ret->closecallback = php_libxml_streams_IO_close;
599-
} else
595+
ret = xmlParserInputBufferCreateIO(php_libxml_streams_IO_read, php_libxml_streams_IO_close, context, enc);
596+
if (ret == NULL) {
600597
php_libxml_streams_IO_close(context);
598+
}
601599

602600
return(ret);
603601
}

0 commit comments

Comments
 (0)