summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2000-07-04 09:15:06 +0000
committerStig Bakken <ssb@php.net>2000-07-04 09:15:06 +0000
commit23ca7b9f1ad0f82efe3760284353807a38d94533 (patch)
tree53d65d197e335d88728e8834df3801a7346effa4
parentf34c1fbee2f9c683350f6fdc03e5ca2ed5b1f59e (diff)
downloadphp-git-23ca7b9f1ad0f82efe3760284353807a38d94533.tar.gz
Added "html_errors" directive to optionally disable HTML formatting of error
messages. The default is on. (Stig)
-rw-r--r--main/main.c10
-rw-r--r--main/php_globals.h2
2 files changed, 10 insertions, 2 deletions
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) ?
+ "<br>\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br>\n"
+ : "\n%s: %s in %s on line %d\n";
if (prepend_string) {
PUTS(prepend_string);
}
- php_printf("<br>\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br>\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;
};