From: Zeev Suraski Date: Fri, 13 Oct 2000 17:07:09 +0000 (+0000) Subject: Fix php_value issue X-Git-Tag: php-4.0.4RC3~689 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce51b944615da22027ead4d59257ece97acdaf93;p=php Fix php_value issue --- diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index ccce6b4ff9..09d732dbe6 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -550,11 +550,11 @@ static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry) static zend_bool should_overwrite_per_dir_entry(php_per_dir_entry *orig_per_dir_entry, php_per_dir_entry *new_per_dir_entry) { - if (orig_per_dir_entry->type==PHP_INI_SYSTEM - && new_per_dir_entry->type!=PHP_INI_SYSTEM) { - return 0; - } else { + if (new_per_dir_entry->type==PHP_INI_SYSTEM + && orig_per_dir_entry->type!=PHP_INI_SYSTEM) { return 1; + } else { + return 0; } } @@ -582,9 +582,10 @@ static void *php_merge_dir(pool *p, void *basev, void *addv) { php_per_dir_entry tmp; - zend_hash_merge_ex((HashTable *) basev, (HashTable *) addv, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (zend_bool (*)(void *, void *)) should_overwrite_per_dir_entry); + /* This function *must* return addv, and not modify basev */ + zend_hash_merge_ex((HashTable *) addv, (HashTable *) basev, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (zend_bool (*)(void *, void *)) should_overwrite_per_dir_entry); /*zend_hash_merge((HashTable *) addv, (HashTable *) basev, (void (*)(void *)) copy_per_dir_entry, &tmp, sizeof(php_per_dir_entry), 0);*/ - return basev; + return addv; }