diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-12-07 02:37:05 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-12-07 02:37:05 +0000 |
commit | 2796160d15463a04acd7088fea379593d2c9caa0 (patch) | |
tree | f440a9907241950110f0d9ae6b51f9429af0fd4c | |
parent | 0e46f5113cf7c854c76900542ed59da1bba24d11 (diff) | |
download | php-git-2796160d15463a04acd7088fea379593d2c9caa0.tar.gz |
Better critical error handling (fix for previous html encoding patch).
-rw-r--r-- | main/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/main/main.c b/main/main.c index 9b9ae472b4..af8faa059a 100644 --- a/main/main.c +++ b/main/main.c @@ -770,12 +770,14 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ char *append_string = INI_STR("error_append_string"); if (PG(html_errors)) { - char *buf, *buf2; - int len2, len = spprintf(&buf, 0, "%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); - buf2 = php_escape_html_entities(buf, len, &len2, 0, ENT_COMPAT, NULL TSRMLS_CC); - php_printf("%s", buf2); - efree(buf); - efree(buf2); + if (type == E_ERROR) { + int len; + char *buf = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC); + php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno, STR_PRINT(append_string)); + efree(buf); + } else { + php_printf("%s<br />\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br />\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); + } } else { php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); } |