From: Stig Bakken Date: Tue, 4 Jul 2000 09:15:06 +0000 (+0000) Subject: Added "html_errors" directive to optionally disable HTML formatting of error X-Git-Tag: PRE_METHOD_CALL_SEPERATE_FIX_PATCH~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23ca7b9f1ad0f82efe3760284353807a38d94533;p=php Added "html_errors" directive to optionally disable HTML formatting of error messages. The default is on. (Stig) --- diff --git a/main/main.c b/main/main.c index 2cc9dcfac8..cf43c3e6c2 100644 --- a/main/main.c +++ b/main/main.c @@ -212,6 +212,7 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("error_append_string", NULL, PHP_INI_ALL, OnUpdateString, error_append_string, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("error_prepend_string", NULL, PHP_INI_ALL, OnUpdateString, error_prepend_string, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("expose_php", "1", PHP_INI_SYSTEM, OnUpdateBool, expose_php, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN("html_errors", "1", PHP_INI_SYSTEM, OnUpdateBool, html_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("ignore_user_abort", "0", PHP_INI_ALL, OnUpdateBool, ignore_user_abort, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("implicit_flush", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateBool, implicit_flush, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals) @@ -334,7 +335,6 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ ELS_FETCH(); PLS_FETCH(); - if (EG(error_reporting) & type || (type & E_CORE)) { char *error_type_str; @@ -386,11 +386,17 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ if (module_initialized && PG(display_errors)) { char *prepend_string = INI_STR("error_prepend_string"); char *append_string = INI_STR("error_append_string"); + char *error_format; + + error_format = PG(html_errors) ? + "
\n%s: %s in %s on line %d
\n" + : "\n%s: %s in %s on line %d\n"; if (prepend_string) { PUTS(prepend_string); } - php_printf("
\n%s: %s in %s on line %d
\n", error_type_str, buffer, error_filename, error_lineno); + php_printf(error_format, error_type_str, buffer, + error_filename, error_lineno); if (append_string) { PUTS(append_string); } diff --git a/main/php_globals.h b/main/php_globals.h index ea0e3e511b..2b3032ba33 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -111,6 +111,8 @@ struct _php_core_globals { zend_bool y2k_compliance; + zend_bool html_errors; + zend_bool modules_activated; };