]> granicus.if.org Git - php/commitdiff
- Fixed bug #34307 (OnUpdateStringUnempty INI options can be set as empty)
authorfoobar <sniper@php.net>
Thu, 1 Sep 2005 14:42:54 +0000 (14:42 +0000)
committerfoobar <sniper@php.net>
Thu, 1 Sep 2005 14:42:54 +0000 (14:42 +0000)
main/main.c
main/php_ini.c
main/php_ini.h

index 0fa9fc0946ec49c59a38587e6587caa0d8925763..0a7339f3231bda9bed72ce7643775012b97b4fd2 100644 (file)
@@ -1535,17 +1535,24 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
 
        le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, "index pointer", 0);
 
+       /* Initialize configuration_hash */
+       if (php_init_config_hash() == FAILURE) {
+               return FAILURE;
+       }
+
+       /* Register PHP core ini entries */
+       REGISTER_INI_ENTRIES();
+
+       /* Register Zend ini entries */
+       zend_register_standard_ini_entries(TSRMLS_C);
 
        /* this will read in php.ini, set up the configuration parameters,
           load zend extensions and register php function extensions 
           to be loaded later */
-       if (php_init_config() == FAILURE) {
+       if (php_init_config(TSRMLS_C) == FAILURE) {
                return FAILURE;
        }
 
-       REGISTER_INI_ENTRIES();
-       zend_register_standard_ini_entries(TSRMLS_C);
-
        orig_unicode = UG(unicode);
        UG(unicode) = 0;
 
index 3745cb4dc06241f7e578531a95df41472de21343..a86dd8ac528f49911b6507de6e1ece7fdff34ebc 100644 (file)
@@ -163,16 +163,6 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
 # endif
 #endif
 
-/* {{{ pvalue_config_destructor
- */
-static void pvalue_config_destructor(zval *pvalue)
-{   
-       if (Z_TYPE_P(pvalue) == IS_STRING) {
-               free(Z_STRVAL_P(pvalue));
-       }
-}
-/* }}} */
-
 /* {{{ php_config_ini_parser_cb
  */
 static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, void *arg)
@@ -254,9 +244,29 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
 }
 /* }}} */
 
+/* {{{ pvalue_config_destructor
+ */
+static void pvalue_config_destructor(zval *pvalue)
+{   
+       if (Z_TYPE_P(pvalue) == IS_STRING) {
+               free(Z_STRVAL_P(pvalue));
+       }
+}
+/* }}} */
+
+/* {{{ php_init_config_hash
+ */
+int php_init_config_hash(void)
+{
+       if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) {
+               return FAILURE;
+       }
+}
+/* }}} */
+
 /* {{{ php_init_config
  */
-int php_init_config()
+int php_init_config(TSRMLS_D)
 {
        char *php_ini_search_path = NULL;
        int safe_mode_state;
@@ -269,11 +279,6 @@ int php_init_config()
        zend_llist scanned_ini_list;
        int l, total_l=0;
        zend_llist_element *element;
-       TSRMLS_FETCH();
-
-       if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) {
-               return FAILURE;
-       }
 
        if (sapi_module.ini_defaults) {
                sapi_module.ini_defaults(&configuration_hash);
index e8630a86897f2058fdd44e195fa6fe1f079f3c6b..1b3c7a0f5be245264b6a03b7e5abbb9141a16df7 100644 (file)
@@ -24,7 +24,8 @@
 #include "zend_ini.h"
 
 BEGIN_EXTERN_C()
-int php_init_config();
+int php_init_config_hash(void);
+int php_init_config(TSRMLS_D);
 int php_shutdown_config(void);
 void php_ini_register_extensions(TSRMLS_D);
 zval *cfg_get_entry(char *name, uint name_length);