Skip to content

Commit 595b746

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix not thread safe RelaxNG invocations in ZTS builds Fix not thread safe xmlSchemaParse calls in ZTS builds
2 parents 8389197 + 75d8449 commit 595b746

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ PHP NEWS
2121
. Fixed bug GH-20070 (Return type violation in imagefilter when an invalid
2222
filter is provided). (Girgias)
2323

24+
- LibXML:
25+
. Fix not thread safe schema/relaxng calls. (SpencerMalone, nielsdos)
26+
2427
- Opcache:
2528
. Fixed bug GH-20081 (access to uninitialized vars in preload_load()).
2629
(Arnaud)

ext/libxml/libxml.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#ifdef LIBXML_SCHEMAS_ENABLED
4141
#include <libxml/relaxng.h>
4242
#include <libxml/xmlschemas.h>
43+
#include <libxml/xmlschemastypes.h>
4344
#endif
4445

4546
#include "php_libxml.h"
@@ -929,7 +930,14 @@ PHP_LIBXML_API void php_libxml_initialize(void)
929930
if (!_php_libxml_initialized) {
930931
/* we should be the only one's to ever init!! */
931932
ZEND_IGNORE_LEAKS_BEGIN();
933+
932934
xmlInitParser();
935+
#ifdef LIBXML_SCHEMAS_ENABLED
936+
xmlSchemaInitTypes();
937+
#endif
938+
#ifdef LIBXML_RELAXNG_ENABLED
939+
xmlRelaxNGInitTypes();
940+
#endif
933941
ZEND_IGNORE_LEAKS_END();
934942

935943
_php_libxml_default_entity_loader = xmlGetExternalEntityLoader();

0 commit comments

Comments
 (0)