From 67f72c465e885834b52516c42213f16355fd026f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 6 Feb 2005 06:33:05 +0000 Subject: [PATCH] * (bug 1477) hide details of SQL error messages by default Set $wgShowSQLErrors = true for debugging. Removed unused settings $wgBufferSQLResults and $wgShowSQLErrors. --- includes/OutputPage.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 8cd46c4327..42c981f265 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -581,7 +581,7 @@ class OutputPage { } function databaseError( $fname, $sql, $error, $errno ) { - global $wgUser, $wgCommandLineMode; + global $wgUser, $wgCommandLineMode, $wgShowSQLErrors; $this->setPageTitle( wfMsgNoDB( 'databaseerror' ) ); $this->setRobotpolicy( 'noindex,nofollow' ); @@ -589,12 +589,20 @@ class OutputPage { $this->enableClientCache( false ); $this->mRedirect = ''; - if ( $wgCommandLineMode ) { - $msg = wfMsgNoDB( 'dberrortextcl', htmlspecialchars( $sql ), - htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) ); + if( $wgShowSQLErrors ) { + if ( $wgCommandLineMode ) { + $msg = wfMsgNoDB( 'dberrortextcl', htmlspecialchars( $sql ), + htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) ); + } else { + $msg = wfMsgNoDB( 'dberrortext', htmlspecialchars( $sql ), + htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) ); + } } else { - $msg = wfMsgNoDB( 'dberrortext', htmlspecialchars( $sql ), - htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) ); + if( $wgCommandLineMode ) { + $msg = wfMsg( 'internalerror' ); + } else { + $msg = htmlspecialchars( wfMsg( 'internalerror' ) ); + } } if ( $wgCommandLineMode || !is_object( $wgUser )) { -- 2.20.1