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

Merge branch 'PHP-8.2'

This commit is contained in:
Bob Weinand
2023-06-30 15:20:55 +02:00
2 changed files with 20 additions and 0 deletions

4
NEWS
View File

@@ -32,6 +32,10 @@ PHP NEWS
- Standard:
. Fix serialization of RC1 objects appearing in object graph twice. (ilutov)
- XMLReader:
. Fix GH-11548 (Argument corruption when calling XMLReader::open or
XMLReader::XML non-statically with observer active). (Bob)
- zip:
. zip extension version 1.22.0 for libzip 1.10.0. (Remi)
. add new error macros (ER_DATA_LENGTH and ER_NOT_ALLOWED). (Remi)

View File

@@ -22,6 +22,7 @@
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "zend_observer.h"
#include "php_xmlreader.h"
#ifdef HAVE_DOM
#include "ext/dom/xml_common.h"
@@ -1147,6 +1148,18 @@ PHP_METHOD(XMLReader, expand)
}
/* }}} */
static zend_result (*prev_zend_post_startup_cb)(void);
static zend_result xmlreader_fixup_temporaries(void) {
if (ZEND_OBSERVER_ENABLED) {
++xmlreader_open_fn.T;
++xmlreader_xml_fn.T;
}
if (prev_zend_post_startup_cb) {
return prev_zend_post_startup_cb();
}
return SUCCESS;
}
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(xmlreader)
{
@@ -1169,6 +1182,9 @@ PHP_MINIT_FUNCTION(xmlreader)
memcpy(&xmlreader_xml_fn, zend_hash_str_find_ptr(&xmlreader_class_entry->function_table, "xml", sizeof("xml")-1), sizeof(zend_internal_function));
xmlreader_xml_fn.fn_flags &= ~ZEND_ACC_STATIC;
prev_zend_post_startup_cb = zend_post_startup_cb;
zend_post_startup_cb = xmlreader_fixup_temporaries;
zend_hash_init(&xmlreader_prop_handlers, 0, NULL, php_xmlreader_free_prop_handler, 1);
xmlreader_register_prop_handler(&xmlreader_prop_handlers, "attributeCount", xmlTextReaderAttributeCount, NULL, IS_LONG);
xmlreader_register_prop_handler(&xmlreader_prop_handlers, "baseURI", NULL, xmlTextReaderConstBaseUri, IS_STRING);