More informative database errors with SQL suppressed

This commit is contained in:
Tim Starling 2005-04-10 09:23:13 +00:00
parent 01eb548552
commit 8d95e6ef85
2 changed files with 10 additions and 13 deletions

View file

@ -599,20 +599,16 @@ class OutputPage {
$this->enableClientCache( false );
$this->mRedirect = '';
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 ) );
}
if( !$wgShowSQLErrors ) {
$sql = wfMsg( 'sqlhidden' );
}
if ( $wgCommandLineMode ) {
$msg = wfMsgNoDB( 'dberrortextcl', htmlspecialchars( $sql ),
htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) );
} else {
if( $wgCommandLineMode ) {
$msg = wfMsg( 'internalerror' );
} else {
$msg = htmlspecialchars( wfMsg( 'internalerror' ) );
}
$msg = wfMsgNoDB( 'dberrortext', htmlspecialchars( $sql ),
htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) );
}
if ( $wgCommandLineMode || !is_object( $wgUser )) {

View file

@ -543,6 +543,7 @@ a number of reasons why this may be so, please see
You can view and copy the source of this page:",
'seriousxhtmlerrors' => 'There were serious xhtml markup errors detected by tidy.',
'sqlhidden' => '(SQL query hidden)',
# Login and logout pages
#