diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index b7ca4998932..072405b40b9 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -437,14 +437,16 @@ ZEND_INI_DISP(zend_ini_boolean_displayer_cb) /* {{{ */ tmp_value_len = 0; } - if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) { - value = 1; - } else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) { - value = 1; - } else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) { - value = 1; - } else if (tmp_value) { - value = atoi(tmp_value); + if (tmp_value) { + if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) { + value = 1; + } else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) { + value = 1; + } else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) { + value = 1; + } else (tmp_value) { + value = atoi(tmp_value); + } } else { value = 0; } diff --git a/main/main.c b/main/main.c index b08fb656346..39ff698ffa1 100644 --- a/main/main.c +++ b/main/main.c @@ -218,7 +218,11 @@ static PHP_INI_MH(OnUpdateTimeout) static int php_get_display_errors_mode(char *value, int value_length) { int mode; - + + if (!value) { + return PHP_DISPLAY_ERRORS_STDOUT; + } + if (value_length == 2 && !strcasecmp("on", value)) { mode = PHP_DISPLAY_ERRORS_STDOUT; } else if (value_length == 3 && !strcasecmp("yes", value)) { @@ -229,14 +233,13 @@ static int php_get_display_errors_mode(char *value, int value_length) mode = PHP_DISPLAY_ERRORS_STDERR; } else if (value_length == 6 && !strcasecmp(value, "stdout")) { mode = PHP_DISPLAY_ERRORS_STDOUT; - } else if (value) { + } else { mode = atoi(value); if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR) { mode = PHP_DISPLAY_ERRORS_STDOUT; } - } else { - mode = PHP_DISPLAY_ERRORS_STDOUT; } + return mode; } /* }}} */