1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 09:03:04 +02:00

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. :)
This commit is contained in:
foobar
2001-11-13 00:37:49 +00:00
parent 62f57095a0
commit 12cfb76b65

View File

@@ -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");
}