From 9c69e4d3ca3ee80155bb5f6f4d19c8572a41241a Mon Sep 17 00:00:00 2001 From: Paul Richards Date: Wed, 11 Jul 2007 22:21:32 +0000 Subject: [PATCH] Fix: Error handler when called with a DB_QUERY_FAILED type of error should 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 --- core/error_api.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/error_api.php b/core/error_api.php index e725633adc..9be972b1e3 100644 --- a/core/error_api.php +++ b/core/error_api.php @@ -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 ### @@ -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 '
'; @@ -139,7 +143,12 @@ function error_handler( $p_type, $p_error, $p_file, $p_line, $p_context ) { PRINT ''; } - 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 "

$t_error_type: $t_error_description

";