summaryrefslogtreecommitdiff
path: root/ext/standard/basic_functions.c
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-11-13 00:37:49 +0000
committerfoobar <sniper@php.net>2001-11-13 00:37:49 +0000
commit12cfb76b65b98413600f4da06a2efcc336d3eb7a (patch)
tree3506efab107c5403f276bbaa7e78ad1b40a04e43 /ext/standard/basic_functions.c
parent62f57095a0554d08d864a61fd7a3f8223a7564f8 (diff)
downloadphp-git-12cfb76b65b98413600f4da06a2efcc336d3eb7a.tar.gz
Fixed the wrong logic in ini_get_all() function.
Now it behaves same as how phpinfo() outputs the ini entries. If there is a local value, then the global one is the 'original one' if there is such. Otherwise global value is same as local. :)
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r--ext/standard/basic_functions.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index c70bff2a2e..7517cb59b0 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2229,14 +2229,16 @@ static int php_ini_get_option(zend_ini_entry *ini_entry, int num_args, va_list a
MAKE_STD_ZVAL(option);
array_init(option);
- if(ini_entry->value) {
+ if(ini_entry->orig_value) {
+ add_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1);
+ } else if (ini_entry->value) {
add_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1);
} else {
add_assoc_null(option, "global_value");
}
- if(ini_entry->orig_value) {
- add_assoc_stringl(option, "local_value", ini_entry->orig_value, ini_entry->orig_value_length, 1);
+ if(ini_entry->value) {
+ add_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1);
} else {
add_assoc_null(option, "local_value");
}