From: Ilia Alshanetsky Date: Tue, 12 Dec 2006 18:05:38 +0000 (+0000) Subject: MFB: Fixed bug #39797 (virtual() does not reset changed INI settings). X-Git-Tag: RELEASE_1_0_0RC1~708 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a918d00548492b78607ef91b0f92a88be62740fa;p=php MFB: Fixed bug #39797 (virtual() does not reset changed INI settings). --- diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index a80baeea3b..715f96caa8 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -462,6 +462,20 @@ static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC) { if (strcmp(r->protocol, "INCLUDED")) { zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); + } else { +typedef struct { + HashTable config; +} php_conf_rec; + char *str; + uint str_len; + php_conf_rec *c = ap_get_module_config(r->per_dir_config, &php5_module); + + for (zend_hash_internal_pointer_reset(&c->config); + zend_hash_get_current_key_ex(&c->config, &str, &str_len, NULL, 0, NULL) == HASH_KEY_IS_STRING; + zend_hash_move_forward(&c->config) + ) { + zend_restore_ini_entry(str, str_len, ZEND_INI_STAGE_SHUTDOWN); + } } if (p) { ((php_struct *)SG(server_context))->r = p;