iliaa Tue Dec 6 21:37:09 2005 EDT Modified files: (Branch: PHP_5_1) /php-src/main main.c Log: Better critical error handling (fix for previous html encoding patch). http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.11&r2=1.640.2.12&ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.640.2.11 php-src/main/main.c:1.640.2.12 --- php-src/main/main.c:1.640.2.11 Tue Dec 6 18:32:06 2005 +++ php-src/main/main.c Tue Dec 6 21:37:05 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.640.2.11 2005/12/06 23:32:06 iliaa Exp $ */ +/* $Id: main.c,v 1.640.2.12 2005/12/07 02:37:05 iliaa Exp $ */ /* {{{ includes */ @@ -770,12 +770,14 @@ 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)); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php