Skip to content

Commit

Permalink
Fix: Error handler when called with a DB_QUERY_FAILED type of error s…
Browse files Browse the repository at this point in the history
…hould not attempt to make additional Database queries

Call Stack
# Time Memory Function Location
1 0.0161 86936 {main}( ) ..(null):0
2 0.2951 10640712 file_add( ) ..(null):45
3 0.3240 13728480 db_query_bound( ) ..(null):669
4 0.3659 13731088 trigger_error ( ) ..(null):220
5 0.3659 13731088 error_handler( ) ..(null):0
6 0.3782 13739008 html_page_top2( ) ..(null):109
7 0.3857 13739328 html_login_info( ) ..(null):119
8 0.4003 13742400 print_project_option_list( ) ..(null):362
9 0.4003 13743176 project_cache_all( ) ..(null):372
10 0.4009 13743776 db_query( ) ..(null):83
11 0.4019 13744384 trigger_error ( ) ..(null):163


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4426 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
mantis committed Jul 11, 2007
1 parent 2f9ef43 commit 9c69e4d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions core/error_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: error_api.php,v 1.50 2007-03-03 15:00:43 prichards Exp $
# $Id: error_api.php,v 1.51 2007-07-11 22:21:32 prichards Exp $
# --------------------------------------------------------

### Error API ###
Expand Down Expand Up @@ -104,9 +104,13 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) {
}

# don't send the page header information if it has already been sent
if ( $g_error_send_page_header ) {
if ( $g_error_send_page_header ) {
html_page_top1();
html_page_top2();
if ( $p_error != ERROR_DB_QUERY_FAILED ) {
html_page_top2();
} else {
html_page_top2a();
}
}

PRINT '<br /><div align="center"><table class="width50" cellspacing="1">';
Expand Down Expand Up @@ -139,7 +143,12 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) {
PRINT '</div>';
}

html_page_bottom1();
if ( $p_error != ERROR_DB_QUERY_FAILED ) {
html_page_bottom1();
} else {
html_body_end();
html_end();
}
exit();
} else if ( 'inline' == $t_method ) {
PRINT "<p style=\"color:red\">$t_error_type: $t_error_description</p>";
Expand Down

0 comments on commit 9c69e4d

Please sign in to comment.