Skip to content

Commit

Permalink
Fix HTML in error page when $g_show_detailed_errors = ON
Browse files Browse the repository at this point in the history
- Added missing </div> causing footer to be hidden behind the sidebar
- Removed unnecessary <p> tags containing <div> and/or <table> tags
- Added a few newlines to make generated HTML easier to read

Fixes #23926
  • Loading branch information
dregad authored and vboctor committed Feb 7, 2018
1 parent bff178e commit a02b5dc
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions core/error_api.php
Expand Up @@ -335,27 +335,23 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, array $p_context )
}

echo '<div class="col-md-12 col-xs-12">';
echo '<div class="space-20"></div>';
echo '<div class="alert alert-danger">';
echo '<div class="space-20"></div>', "\n";
echo '<div class="alert alert-danger">', "\n";

echo '<p class="bold">' . $t_error_type . '</p>';
echo '<p>', $t_error_description, '</p>';
echo '<p class="bold">' . $t_error_type . '</p>', "\n";
echo '<p>', $t_error_description, '</p>', "\n";

echo '<div class="error-info">';
if( null === $g_error_proceed_url ) {
echo lang_get( 'error_no_proceed' );
} else {
echo '<a href="', $g_error_proceed_url, '">', lang_get( 'proceed' ), '</a>';
}
echo '</div>';
echo '</div>', "\n";

if( $t_show_detailed_errors ) {
echo '<p>';
error_print_details( $p_file, $p_line, $p_context );
echo '</p>';
echo '<p>';
error_print_stack_trace();
echo '</p>';
}
echo '</div></div>';

Expand Down Expand Up @@ -539,7 +535,7 @@ function error_print_stack_trace( $p_exception = null ) {

echo '<div class="table-responsive">';
echo '<table class="table table-bordered table-striped table-condensed">';
echo '<tr><th>Filename</th><th>Line</th><th></th><th></th><th>Function</th><th>Args</th></tr>';
echo '<tr><th>Filename</th><th>Line</th><th></th><th></th><th>Function</th><th>Args</th></tr>', "\n";

$t_stack = error_stack_trace( $p_exception );

Expand All @@ -552,13 +548,12 @@ function error_print_stack_trace( $p_exception = null ) {
foreach( $t_frame['args'] as $t_value ) {
$t_args[] = error_build_parameter_string( $t_value );
}
echo '<td>( ', htmlentities( implode( $t_args, ', ' ), ENT_COMPAT, 'UTF-8' ), ' )</td></tr>';
echo '<td>( ', htmlentities( implode( $t_args, ', ' ), ENT_COMPAT, 'UTF-8' ), ' )</td></tr>', "\n";
} else {
echo '<td>-</td></tr>';
echo '<td>-</td></tr>', "\n";
}
}

echo '</table>';
echo '</table>', '</div>';
}

/**
Expand Down

0 comments on commit a02b5dc

Please sign in to comment.