Skip to content

Commit 872028d

Browse files
committed
fix TS issues with url rewrite globals
1 parent dfed09a commit 872028d

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

ext/standard/basic_functions.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,6 +3484,12 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
34843484
memset(&BG(url_adapt_session_ex), 0, sizeof(BG(url_adapt_session_ex)));
34853485
memset(&BG(url_adapt_output_ex), 0, sizeof(BG(url_adapt_output_ex)));
34863486

3487+
BG(url_adapt_session_ex).type = 1;
3488+
BG(url_adapt_output_ex).type = 0;
3489+
3490+
zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1);
3491+
zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1);
3492+
34873493
#if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
34883494
memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
34893495
#endif
@@ -3504,6 +3510,9 @@ static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */
35043510
zend_hash_destroy(basic_globals_p->url_adapt_output_ex.tags);
35053511
free(basic_globals_p->url_adapt_output_ex.tags);
35063512
}
3513+
3514+
zend_hash_destroy(&basic_globals_p->url_adapt_session_hosts_ht);
3515+
zend_hash_destroy(&basic_globals_p->url_adapt_output_hosts_ht);
35073516
}
35083517
/* }}} */
35093518

ext/standard/url_scanner_ex.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,17 +1444,6 @@ PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode)
14441444

14451445
PHP_MINIT_FUNCTION(url_scanner)
14461446
{
1447-
BG(url_adapt_session_ex).tags = NULL;
1448-
BG(url_adapt_session_ex).form_app.s = BG(url_adapt_session_ex).url_app.s = NULL;
1449-
zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1);
1450-
1451-
BG(url_adapt_output_ex).tags = NULL;
1452-
BG(url_adapt_output_ex).form_app.s = BG(url_adapt_output_ex).url_app.s = NULL;
1453-
zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1);
1454-
1455-
BG(url_adapt_session_ex).type = 1;
1456-
BG(url_adapt_output_ex).type = 0;
1457-
14581447
REGISTER_INI_ENTRIES();
14591448
return SUCCESS;
14601449
}

ext/standard/url_scanner_ex.re

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -962,17 +962,6 @@ PHPAPI int php_url_scanner_reset_var(zend_string *name, int encode)
962962

963963
PHP_MINIT_FUNCTION(url_scanner)
964964
{
965-
BG(url_adapt_session_ex).tags = NULL;
966-
BG(url_adapt_session_ex).form_app.s = BG(url_adapt_session_ex).url_app.s = NULL;
967-
zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1);
968-
969-
BG(url_adapt_output_ex).tags = NULL;
970-
BG(url_adapt_output_ex).form_app.s = BG(url_adapt_output_ex).url_app.s = NULL;
971-
zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1);
972-
973-
BG(url_adapt_session_ex).type = 1;
974-
BG(url_adapt_output_ex).type = 0;
975-
976965
REGISTER_INI_ENTRIES();
977966
return SUCCESS;
978967
}

0 commit comments

Comments
 (0)