@@ -868,14 +868,11 @@ void xdebug_append_error_footer(xdebug_str *str, int html)
868868
869869char * xdebug_get_printable_stack (int html , int error_type , const char * buffer , const char * error_filename , const int error_lineno , int include_decription )
870870{
871- char * prepend_string ;
872- char * append_string ;
873- char * error_type_str = xdebug_error_type (error_type );
874- char * error_type_str_simple = xdebug_error_type_simple (error_type );
875- xdebug_str str = XDEBUG_STR_INITIALIZER ;
876-
877- prepend_string = INI_STR ((char * ) "error_prepend_string" );
878- append_string = INI_STR ((char * ) "error_append_string" );
871+ char * error_type_str = xdebug_error_type (error_type );
872+ char * error_type_str_simple = xdebug_error_type_simple (error_type );
873+ xdebug_str str = XDEBUG_STR_INITIALIZER ;
874+ char * prepend_string = INI_STR ((char * ) "error_prepend_string" );
875+ char * append_string = INI_STR ((char * ) "error_append_string" );
879876
880877 if (prepend_string ) {
881878 xdebug_str_add (& str , prepend_string , 0 );
@@ -941,16 +938,23 @@ static char *xdebug_handle_stack_trace(int type, char *error_type_str, const cha
941938
942939 /* We need to see if we have an uncaught exception fatal error now */
943940 if (type == E_ERROR && ((tmp_buf = xdebug_strip_php_stack_trace (buffer )) != NULL )) {
944- xdebug_str str = XDEBUG_STR_INITIALIZER ;
941+ xdebug_str str = XDEBUG_STR_INITIALIZER ;
942+ char * prepend_string = INI_STR ((char * ) "error_prepend_string" );
943+ char * append_string = INI_STR ((char * ) "error_append_string" );
945944
946- /* Append error */
945+ if (prepend_string ) {
946+ xdebug_str_add (& str , prepend_string , 0 );
947+ }
947948 xdebug_append_error_head (& str , PG (html_errors ), "uncaught-exception" );
948949 xdebug_append_error_description (& str , PG (html_errors ), error_type_str , tmp_buf , error_filename , error_lineno );
949950 xdebug_append_printable_stack (& str , PG (html_errors ));
950951 if (XG_BASE (last_exception_trace )) {
951952 xdebug_str_add (& str , XG_BASE (last_exception_trace ), 0 );
952953 }
953954 xdebug_append_error_footer (& str , PG (html_errors ));
955+ if (append_string ) {
956+ xdebug_str_add (& str , append_string , 0 );
957+ }
954958
955959 free (tmp_buf );
956960 printable_stack = str .d ;
@@ -1195,7 +1199,6 @@ void xdebug_develop_throw_exception_hook(zend_object *exception, zval *file, zva
11951199 zend_class_entry * exception_ce = exception -> ce ;
11961200 char * exception_trace ;
11971201 xdebug_str tmp_str = XDEBUG_STR_INITIALIZER ;
1198-
11991202 zval * z_previous_exception , * z_last_exception_slot , * z_previous_trace ;
12001203 zend_object * previous_exception_obj = exception ;
12011204 zval dummy ;
@@ -1265,9 +1268,18 @@ void xdebug_develop_throw_exception_hook(zend_object *exception, zval *file, zva
12651268 }
12661269 if (PG (display_errors )) {
12671270 xdebug_str displ_tmp_str = XDEBUG_STR_INITIALIZER ;
1271+ char * prepend_string = INI_STR ((char * ) "error_prepend_string" );
1272+ char * append_string = INI_STR ((char * ) "error_append_string" );
1273+
1274+ if (prepend_string ) {
1275+ xdebug_str_add (& displ_tmp_str , prepend_string , 0 );
1276+ }
12681277 xdebug_append_error_head (& displ_tmp_str , PG (html_errors ), "exception" );
12691278 xdebug_str_add (& displ_tmp_str , exception_trace , 0 );
12701279 xdebug_append_error_footer (& displ_tmp_str , PG (html_errors ));
1280+ if (append_string ) {
1281+ xdebug_str_add (& displ_tmp_str , append_string , 0 );
1282+ }
12711283
12721284 php_printf ("%s" , displ_tmp_str .d );
12731285 xdebug_str_destroy (& displ_tmp_str );
0 commit comments