summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/main.c b/main/main.c
index 223830aab5..bb03f1b16f 100644
--- a/main/main.c
+++ b/main/main.c
@@ -623,8 +623,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
/* get error text into buffer and escape for html if necessary */
buffer_len = vspprintf(&buffer, 0, format, args);
+
if (PG(html_errors)) {
- int len;
+ size_t len;
char *replace = php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC);
efree(buffer);
buffer = replace;
@@ -682,7 +683,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
}
if (PG(html_errors)) {
- int len;
+ size_t len;
char *replace = php_escape_html_entities(origin, origin_len, &len, 0, ENT_COMPAT, NULL TSRMLS_CC);
efree(origin);
origin = replace;
@@ -981,7 +982,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
if (PG(html_errors)) {
if (type == E_ERROR) {
- int len;
+ size_t 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);