Skip to content

Commit 7cd7026

Browse files
committed
Fix Bug #64776 The XSLT extension is not thread safe.
1 parent df484b0 commit 7cd7026

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 20??, PHP 5.7.0
44

5+
- XSL:
6+
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
7+
58
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

ext/xsl/php_xsl.c

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ zend_module_entry xsl_module_entry = {
5757
xsl_functions,
5858
PHP_MINIT(xsl),
5959
PHP_MSHUTDOWN(xsl),
60-
PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */
61-
PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */
60+
NULL,
61+
NULL,
6262
PHP_MINFO(xsl),
6363
#if ZEND_MODULE_API_NO >= 20010901
6464
"0.1", /* Replace with version number for your extension */
@@ -170,6 +170,7 @@ PHP_MINIT_FUNCTION(xsl)
170170
xsltRegisterExtModuleFunction ((const xmlChar *) "function",
171171
(const xmlChar *) "http://php.net/xsl",
172172
xsl_ext_function_object_php);
173+
xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
173174

174175
REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT);
175176
REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT);
@@ -273,7 +274,7 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
273274
(const xmlChar *) "http://php.net/xsl");
274275
xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
275276
(const xmlChar *) "http://php.net/xsl");
276-
277+
xsltSetGenericErrorFunc(NULL, NULL);
277278
xsltCleanupGlobals();
278279

279280
UNREGISTER_INI_ENTRIES();
@@ -282,24 +283,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
282283
}
283284
/* }}} */
284285

285-
/* {{{ PHP_RINIT_FUNCTION
286-
*/
287-
PHP_RINIT_FUNCTION(xsl)
288-
{
289-
xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
290-
return SUCCESS;
291-
}
292-
/* }}} */
293-
294-
/* {{{ PHP_RSHUTDOWN_FUNCTION
295-
*/
296-
PHP_RSHUTDOWN_FUNCTION(xsl)
297-
{
298-
xsltSetGenericErrorFunc(NULL, NULL);
299-
return SUCCESS;
300-
}
301-
/* }}} */
302-
303286
/* {{{ PHP_MINFO_FUNCTION
304287
*/
305288
PHP_MINFO_FUNCTION(xsl)

0 commit comments

Comments
 (0)