Skip to content

Commit cbaaf1b

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #39797 (virtual() does not reset changed INI settings).
1 parent e034b4a commit cbaaf1b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ PHP NEWS
5050
- Fixed FastCGI impersonation for persistent connections on Windows. (Dmitry)
5151
- Fixed wrong signature initialization in imagepng (Takeshi Abe)
5252
- Added optimization for imageline with horizontal and vertial lines (Pierre)
53+
- Fixed bug #39797 (virtual() does not reset changed INI settings). (Ilia)
5354
- Fixed bug #39795 (build fails on AIX because crypt_r() uses different data
5455
struct). (Tony)
5556
- Fixed bug #39791 (Crash in strtotime() on overly long relative date

sapi/apache2handler/sapi_apache2.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,20 @@ static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC)
467467
{
468468
if (strcmp(r->protocol, "INCLUDED")) {
469469
zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try();
470+
} else {
471+
typedef struct {
472+
HashTable config;
473+
} php_conf_rec;
474+
char *str;
475+
uint str_len;
476+
php_conf_rec *c = ap_get_module_config(r->per_dir_config, &php5_module);
477+
478+
for (zend_hash_internal_pointer_reset(&c->config);
479+
zend_hash_get_current_key_ex(&c->config, &str, &str_len, NULL, 0, NULL) == HASH_KEY_IS_STRING;
480+
zend_hash_move_forward(&c->config)
481+
) {
482+
zend_restore_ini_entry(str, str_len, ZEND_INI_STAGE_SHUTDOWN);
483+
}
470484
}
471485
if (p) {
472486
((php_struct *)SG(server_context))->r = p;

0 commit comments

Comments
 (0)