Skip to content

Commit e0908b7

Browse files
committed
Fix not thread safe xmlSchemaParse calls in ZTS builds by calling xmlSchemaInitTypes during MINIT. See: https://gitlab.gnome.org/GNOME/libxml2/-/issues/930
1 parent 416386a commit e0908b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/dom/php_dom.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include "zend_interfaces.h"
3030

3131
#include "ext/standard/info.h"
32+
#ifdef LIBXML_SCHEMAS_ENABLED
33+
#include <libxml/xmlschemastypes.h>
34+
#endif
3235
#define PHP_XPATH 1
3336
#define PHP_XPTR 2
3437

@@ -864,6 +867,10 @@ PHP_MINIT_FUNCTION(dom)
864867

865868
php_libxml_register_export(dom_node_class_entry, php_dom_export_node);
866869

870+
#ifdef LIBXML_SCHEMAS_ENABLED
871+
xmlSchemaInitTypes();
872+
#endif
873+
867874
return SUCCESS;
868875
}
869876
/* }}} */

0 commit comments

Comments
 (0)