cvs: ZendEngine2(PHP_5_1) / zend_ini.c

From: Date: Fri, 02 Sep 2005 20:51:16 +0000
Subject: cvs: ZendEngine2(PHP_5_1) / zend_ini.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4099@lists.php.net to get a copy of this message
andrei Fri Sep 2 16:51:16 2005 EDT Modified files: (Branch: PHP_5_1) /ZendEngine2 zend_ini.c Log: Fix bug #34307. We were not calling on_modify handler to set the default value in case setting the one from .ini file failed. http://cvs.php.net/diff.php/ZendEngine2/zend_ini.c?r1=1.39&r2=1.39.2.1&ty=u Index: ZendEngine2/zend_ini.c diff -u ZendEngine2/zend_ini.c:1.39 ZendEngine2/zend_ini.c:1.39.2.1 --- ZendEngine2/zend_ini.c:1.39 Wed Aug 3 09:30:53 2005 +++ ZendEngine2/zend_ini.c Fri Sep 2 16:51:15 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini.c,v 1.39 2005/08/03 13:30:53 sniper Exp $ */ +/* $Id: zend_ini.c,v 1.39.2.1 2005/09/02 20:51:15 andrei Exp $ */ #include "zend.h" #include "zend_qsort.h" @@ -154,6 +154,7 @@ 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 @@ 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 @@ || 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++; }

« previous php.zend-engine.cvs (#4099) next »