summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>1999-10-15 19:55:18 +0000
committerAndrei Zmievski <andrei@php.net>1999-10-15 19:55:18 +0000
commit3ee9dbea0c20d071aa62aaab11f4454345c06711 (patch)
tree714dd1ee9a161ae4c6733e8c17c86d15898ac39b /main
parentc671332b29840a0add6c38af244a44bcacf6f510 (diff)
downloadphp-git-3ee9dbea0c20d071aa62aaab11f4454345c06711.tar.gz
(php_error): finally get rid of those annoying html tags
when running as CGI binary
Diffstat (limited to 'main')
-rw-r--r--main/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c
index 9e1205ee02..c2c5a49647 100644
--- a/main/main.c
+++ b/main/main.c
@@ -81,6 +81,11 @@ struct sapi_request_info *sapi_rqst;
#include "php_getopt.h"
#endif
+#if CGI_BINARY
+#define PHP_ERROR_FORMAT "PHP %s: %s in %s on line %d"
+#else
+#define PHP_ERROR_FORMAT "<br>\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br>"
+#endif
#ifndef ZTS
php_core_globals core_globals;
@@ -443,7 +448,7 @@ PHPAPI void php_error(int type, const char *format,...)
if (PG(log_errors)) {
char log_buffer[1024];
- snprintf(log_buffer, 1024, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
+ snprintf(log_buffer, 1024, PHP_ERROR_FORMAT, error_type_str, buffer, error_filename, error_lineno);
php3_log_err(log_buffer);
}
if (PG(display_errors)) {
@@ -453,7 +458,7 @@ PHPAPI void php_error(int type, const char *format,...)
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(PHP_ERROR_FORMAT "\n", error_type_str, buffer, error_filename, error_lineno);
if (append_string) {
PUTS(append_string);
}