From: Tim Starling Date: Sun, 10 Apr 2005 09:23:13 +0000 (+0000) Subject: More informative database errors with SQL suppressed X-Git-Tag: 1.5.0alpha1~316 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=8d95e6ef85c01726bed0286b7f35dfd48f25b92d;p=lhc%2Fweb%2Fwiklou.git More informative database errors with SQL suppressed --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 61f9ee3834..f00c58a17c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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 )) { diff --git a/languages/Language.php b/languages/Language.php index 871658c228..d6742239aa 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 #