From 872028de20b91e25428205f49fc036a09d4b001d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 20 Aug 2016 22:39:14 +0200 Subject: [PATCH] fix TS issues with url rewrite globals --- ext/standard/basic_functions.c | 9 +++++++++ ext/standard/url_scanner_ex.c | 11 ----------- ext/standard/url_scanner_ex.re | 11 ----------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ef628cc6cb..5463665a09 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3484,6 +3484,12 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */ memset(&BG(url_adapt_session_ex), 0, sizeof(BG(url_adapt_session_ex))); memset(&BG(url_adapt_output_ex), 0, sizeof(BG(url_adapt_output_ex))); + BG(url_adapt_session_ex).type = 1; + BG(url_adapt_output_ex).type = 0; + + zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1); + zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1); + #if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T) memset(&BG(mblen_state), 0, sizeof(BG(mblen_state))); #endif @@ -3504,6 +3510,9 @@ static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */ zend_hash_destroy(basic_globals_p->url_adapt_output_ex.tags); free(basic_globals_p->url_adapt_output_ex.tags); } + + zend_hash_destroy(&basic_globals_p->url_adapt_session_hosts_ht); + zend_hash_destroy(&basic_globals_p->url_adapt_output_hosts_ht); } /* }}} */ diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 880332ead7..a798b5ccba 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1444,17 +1444,6 @@ PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode) PHP_MINIT_FUNCTION(url_scanner) { - BG(url_adapt_session_ex).tags = NULL; - BG(url_adapt_session_ex).form_app.s = BG(url_adapt_session_ex).url_app.s = NULL; - zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1); - - BG(url_adapt_output_ex).tags = NULL; - BG(url_adapt_output_ex).form_app.s = BG(url_adapt_output_ex).url_app.s = NULL; - zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1); - - BG(url_adapt_session_ex).type = 1; - BG(url_adapt_output_ex).type = 0; - REGISTER_INI_ENTRIES(); return SUCCESS; } diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index e0e74d03fa..2f847262ff 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -962,17 +962,6 @@ PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode) PHP_MINIT_FUNCTION(url_scanner) { - BG(url_adapt_session_ex).tags = NULL; - BG(url_adapt_session_ex).form_app.s = BG(url_adapt_session_ex).url_app.s = NULL; - zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1); - - BG(url_adapt_output_ex).tags = NULL; - BG(url_adapt_output_ex).form_app.s = BG(url_adapt_output_ex).url_app.s = NULL; - zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1); - - BG(url_adapt_session_ex).type = 1; - BG(url_adapt_output_ex).type = 0; - REGISTER_INI_ENTRIES(); return SUCCESS; } -- 2.40.0