mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Stop relying on the deprecated xmlLastError global
This commit is contained in:
parent
ef80266d99
commit
d80be78efd
1 changed files with 9 additions and 9 deletions
|
@ -843,14 +843,8 @@ PHP_LIBXML_API void php_libxml_pretend_ctx_error_ex(const char *file, int line,
|
|||
/* Propagate back into libxml */
|
||||
if (LIBXML(error_list)) {
|
||||
xmlErrorPtr last = zend_llist_get_last(LIBXML(error_list));
|
||||
if (last) {
|
||||
if (!last->file) {
|
||||
last->file = strdup(file);
|
||||
}
|
||||
/* Until there is a replacement */
|
||||
ZEND_DIAGNOSTIC_IGNORED_START("-Wdeprecated-declarations")
|
||||
xmlCopyError(last, &xmlLastError);
|
||||
ZEND_DIAGNOSTIC_IGNORED_END
|
||||
if (last && !last->file) {
|
||||
last->file = strdup(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1126,7 +1120,13 @@ PHP_FUNCTION(libxml_get_last_error)
|
|||
{
|
||||
ZEND_PARSE_PARAMETERS_NONE();
|
||||
|
||||
const xmlError *error = xmlGetLastError();
|
||||
const xmlError *error;
|
||||
|
||||
if (LIBXML(error_list)) {
|
||||
error = zend_llist_get_last(LIBXML(error_list));
|
||||
} else {
|
||||
error = xmlGetLastError();
|
||||
}
|
||||
|
||||
if (error) {
|
||||
php_libxml_create_error_object(return_value, error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue