]> granicus.if.org Git - php/commitdiff
fix TS issues with url rewrite globals
authorAnatol Belski <ab@php.net>
Sat, 20 Aug 2016 20:39:14 +0000 (22:39 +0200)
committerAnatol Belski <ab@php.net>
Sat, 20 Aug 2016 20:41:06 +0000 (22:41 +0200)
ext/standard/basic_functions.c
ext/standard/url_scanner_ex.c
ext/standard/url_scanner_ex.re

index ef628cc6cba0635bca5bec8d114ab1e455f2a9b6..5463665a09a455b736995758378174f255ce8cfd 100644 (file)
@@ -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);
 }
 /* }}} */
 
index 880332ead709c34e708ab7a18ddf82c8b51bd4b5..a798b5ccba646f2e0389cc82e16c982e77ffc4f4 100644 (file)
@@ -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;
 }
index e0e74d03fadd7294ea099df23a3a402b334c04ca..2f847262ff2761391e08754c7d6f740acbf3707f 100644 (file)
@@ -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;
 }