diff options
author | Andrei Zmievski <andrei@php.net> | 2005-09-02 20:51:15 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2005-09-02 20:51:15 +0000 |
commit | 0eabbc9f896fee75d920b1630f397b7b0c67f329 (patch) | |
tree | 0149fa4de53058dd9ed9c5c5cd911b6d6639818a /Zend/zend_ini.c | |
parent | a8355965bb058ccbd2606931563c6584e00fa226 (diff) | |
download | php-git-0eabbc9f896fee75d920b1630f397b7b0c67f329.tar.gz |
Fix bug #34307. We were not calling on_modify handler to set the default
value in case setting the one from .ini file failed.
Diffstat (limited to 'Zend/zend_ini.c')
-rw-r--r-- | Zend/zend_ini.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 91e320b621..cc7570ed2c 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -154,6 +154,7 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num zend_ini_entry *hashed_ini_entry; zval default_value; HashTable *directives = registered_zend_ini_directives; + zend_bool config_directive_success = 0; #ifdef ZTS /* if we are called during the request, eg: from dl(), @@ -171,6 +172,7 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num while (p->name) { p->module_number = module_number; + config_directive_success = 0; if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) { zend_unregister_ini_entries(module_number TSRMLS_CC); return FAILURE; @@ -180,11 +182,12 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num || hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) { hashed_ini_entry->value = default_value.value.str.val; hashed_ini_entry->value_length = default_value.value.str.len; + config_directive_success = 1; } - } else { - if (hashed_ini_entry->on_modify) { - hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); - } + } + + if (!config_directive_success && hashed_ini_entry->on_modify) { + hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); } p++; } |