Skip to content

Commit 72f19e9

Browse files
committed
Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)
1 parent d74d88f commit 72f19e9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ PHP NEWS
1010
(Laruence)
1111

1212
- Core:
13+
. Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
14+
(Laruence)
1315
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
1416
. Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
1517
. Fixed bug #61761 ('Overriding' a private static method with a different

Zend/zend.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */
781781
void zend_post_startup(TSRMLS_D) /* {{{ */
782782
{
783783
#ifdef ZTS
784+
zend_encoding **script_encoding_list;
785+
784786
zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);
785787
zend_executor_globals *executor_globals = ts_resource(executor_globals_id);
786788

@@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
795797
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
796798
free(compiler_globals->function_table);
797799
free(compiler_globals->class_table);
798-
compiler_globals_ctor(compiler_globals, tsrm_ls);
800+
if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {
801+
compiler_globals_ctor(compiler_globals, tsrm_ls);
802+
compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;
803+
} else {
804+
compiler_globals_ctor(compiler_globals, tsrm_ls);
805+
}
799806
free(EG(zend_constants));
800807
executor_globals_ctor(executor_globals, tsrm_ls);
801808
global_persistent_list = &EG(persistent_list);

0 commit comments

Comments
 (0)