From 12cfb76b65b98413600f4da06a2efcc336d3eb7a Mon Sep 17 00:00:00 2001 From: foobar Date: Tue, 13 Nov 2001 00:37:49 +0000 Subject: [PATCH] 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. :) --- ext/standard/basic_functions.c | 8 +++++--- 1 file 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"); } -- 2.50.1