More informative database errors with SQL suppressed
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 10 Apr 2005 09:23:13 +0000 (09:23 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 10 Apr 2005 09:23:13 +0000 (09:23 +0000)
includes/OutputPage.php
languages/Language.php

index 61f9ee3..f00c58a 100644 (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 )) {
index 871658c..d674223 100644 (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
 #