mike Fri Jun 9 15:13:58 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/apache2handler apache_config.c Log: MFH: fix bug #37720 (merge_php_config scrambles values) http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache2handler/apache_config.c?r1=1.7.2.1&r2=1.7.2.2&diff_format=u Index: php-src/sapi/apache2handler/apache_config.c diff -u php-src/sapi/apache2handler/apache_config.c:1.7.2.1 php-src/sapi/apache2handler/apache_config.c:1.7.2.2 --- php-src/sapi/apache2handler/apache_config.c:1.7.2.1 Sun Jan 1 12:50:18 2006 +++ php-src/sapi/apache2handler/apache_config.c Fri Jun 9 15:13:58 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: apache_config.c,v 1.7.2.1 2006/01/01 12:50:18 sniper Exp $ */ +/* $Id: apache_config.c,v 1.7.2.2 2006/06/09 15:13:58 mike Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -118,27 +118,31 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) { - php_conf_rec *d = base_conf, *e = new_conf; + php_conf_rec *d = base_conf, *e = new_conf, *n = NULL; php_dir_entry *pe; php_dir_entry *data; char *str; uint str_len; ulong num_index; - phpapdebug((stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf)); + n = create_php_config(p, "merge_php_config"); + zend_hash_copy(&n->config, &e->config, NULL, NULL, sizeof(php_dir_entry)); + + phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n)); for (zend_hash_internal_pointer_reset(&d->config); zend_hash_get_current_key_ex(&d->config, &str, &str_len, &num_index, 0, NULL) == HASH_KEY_IS_STRING; zend_hash_move_forward(&d->config)) { pe = NULL; zend_hash_get_current_data(&d->config, (void **) &data); - if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) { + if (zend_hash_find(&n->config, str, str_len, (void **) &pe) == SUCCESS) { if (pe->status >= data->status) continue; } - zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL); + zend_hash_update(&n->config, str, str_len, data, sizeof(*data), NULL); phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1)); } - return new_conf; + + return n; } char *get_php_config(void *conf, char *name, size_t name_len)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php