Skip to content

Commit e28e891

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: libxml: Fix input buffer deprecation
2 parents 9762c44 + aa9619e commit e28e891

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
@@ -526,6 +526,7 @@ static int php_libxml_streams_IO_close(void *context)
526526
return php_stream_close((php_stream*)context);
527527
}
528528

529+
/* TODO: This needs to be replaced by context-specific APIs in the future! */
529530
static xmlParserInputBufferPtr
530531
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
531532
{
@@ -560,13 +561,10 @@ php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
560561
}
561562

562563
/* Allocate the Input buffer front-end. */
563-
ret = xmlAllocParserInputBuffer(enc);
564-
if (ret != NULL) {
565-
ret->context = context;
566-
ret->readcallback = php_libxml_streams_IO_read;
567-
ret->closecallback = php_libxml_streams_IO_close;
568-
} else
564+
ret = xmlParserInputBufferCreateIO(php_libxml_streams_IO_read, php_libxml_streams_IO_close, context, enc);
565+
if (ret == NULL) {
569566
php_libxml_streams_IO_close(context);
567+
}
570568

571569
return ret;
572570
}

0 commit comments

Comments
 (0)