summaryrefslogtreecommitdiff
path: root/Zend/zend_ini.c
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-09-27 17:05:23 +0000
committerJani Taskinen <jani@php.net>2007-09-27 17:05:23 +0000
commitfc0e59073e23fa280ec32c8054113a3a65658975 (patch)
treede8b39970314828951aa1a135e8d88c0f0d34a99 /Zend/zend_ini.c
parent6700a20e64c0f4ae08c0f74b3e9f9e9a9e8bdf07 (diff)
downloadphp-git-fc0e59073e23fa280ec32c8054113a3a65658975.tar.gz
MFH:- Fixed bug #42657 (ini_get() returns incorrect value when default is NULL)
Diffstat (limited to 'Zend/zend_ini.c')
-rw-r--r--Zend/zend_ini.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index 1a21c10474..c80ff30afa 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -237,7 +237,7 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) /* {{{ */
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) /* {{{ */
{
TSRMLS_FETCH();
-
+
return zend_alter_ini_entry_ex(name, name_length, new_value, new_value_length, modify_type, stage, 0 TSRMLS_CC);
}
/* }}} */
@@ -336,8 +336,8 @@ ZEND_API long zend_ini_long(char *name, uint name_length, int orig) /* {{{ */
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
- } else if (ini_entry->value) {
- return strtol(ini_entry->value, NULL, 0);
+ } else {
+ return (ini_entry->value ? strtol(ini_entry->value, NULL, 0) : 0);
}
}
@@ -353,8 +353,8 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig) /* {{{ *
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0);
- } else if (ini_entry->value) {
- return (double) zend_strtod(ini_entry->value, NULL);
+ } else {
+ return (double) (ini_entry->value ? zend_strtod(ini_entry->value, NULL) : 0.0);
}
}
@@ -369,10 +369,12 @@ ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) /* {{{ */
if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
if (orig && ini_entry->modified) {
- return ini_entry->orig_value;
+ return ini_entry->orig_value ? ini_entry->orig_value : "";
} else {
- return ini_entry->value;
+ return ini_entry->value ? ini_entry->value : "";
}
+ } else {
+ return NULL;
}
return "";