r7375 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7374‎ | r7375 | r7376 >
Date:05:47, 6 February 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 1477) hide details of SQL error messages by default
Set $wgShowSQLErrors = true for debugging.

Removed unused settings $wgBufferSQLResults and $wgShowSQLErrors.
Modified paths:
  • /branches/REL1_4/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_4/phase3/includes/DefaultSettings.php (modified) (history)
  • /branches/REL1_4/phase3/includes/OutputPage.php (modified) (history)
  • /branches/REL1_4/phase3/includes/SpecialSitesettings.php (modified) (history)

Diff [purge]

Index: branches/REL1_4/phase3/includes/SpecialSitesettings.php
@@ -170,7 +170,6 @@
171171 $this->checkbox( 'wgDebugComments' ) .
172172 $this->checkbox( 'wgLogQueries' ) .
173173 $this->checkbox( 'wgDebugDumpSql' ) .
174 - $this->checkbox( 'wgIgnoreSQLErrors' ) .
175174 $this->fieldset( 'sitesettings-debugging-profiling',
176175 $this->checkbox( 'wgProfiling' ) .
177176 $this->textbox( 'wgProfileLimit' ) .
Index: branches/REL1_4/phase3/includes/OutputPage.php
@@ -581,7 +581,7 @@
582582 }
583583
584584 function databaseError( $fname, $sql, $error, $errno ) {
585 - global $wgUser, $wgCommandLineMode;
 585+ global $wgUser, $wgCommandLineMode, $wgShowSQLErrors;
586586
587587 $this->setPageTitle( wfMsgNoDB( 'databaseerror' ) );
588588 $this->setRobotpolicy( 'noindex,nofollow' );
@@ -589,12 +589,20 @@
590590 $this->enableClientCache( false );
591591 $this->mRedirect = '';
592592
593 - if ( $wgCommandLineMode ) {
594 - $msg = wfMsgNoDB( 'dberrortextcl', htmlspecialchars( $sql ),
595 - htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) );
 593+ if( $wgShowSQLErrors ) {
 594+ if ( $wgCommandLineMode ) {
 595+ $msg = wfMsgNoDB( 'dberrortextcl', htmlspecialchars( $sql ),
 596+ htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) );
 597+ } else {
 598+ $msg = wfMsgNoDB( 'dberrortext', htmlspecialchars( $sql ),
 599+ htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) );
 600+ }
596601 } else {
597 - $msg = wfMsgNoDB( 'dberrortext', htmlspecialchars( $sql ),
598 - htmlspecialchars( $fname ), $errno, htmlspecialchars( $error ) );
 602+ if( $wgCommandLineMode ) {
 603+ $msg = wfMsg( 'internalerror' );
 604+ } else {
 605+ $msg = htmlspecialchars( wfMsg( 'internalerror' ) );
 606+ }
599607 }
600608
601609 if ( $wgCommandLineMode || !is_object( $wgUser )) {
Index: branches/REL1_4/phase3/includes/DefaultSettings.php
@@ -271,8 +271,6 @@
272272 $wgDBmysql4 = false; # Set to true to use enhanced fulltext search
273273 $wgSqlTimeout = 30;
274274
275 -$wgBufferSQLResults = true; # use buffered queries by default
276 -
277275 # Other wikis on this site, can be administered from a single developer account
278276 # Array, interwiki prefix => database name
279277 $wgLocalDatabases = array();
@@ -394,9 +392,10 @@
395393 $wgLogQueries = false;
396394 $wgDebugDumpSql = false;
397395
398 -# Whether to disable automatic generation of "we're sorry,
399 -# but there has been a database error" pages.
400 -$wgIgnoreSQLErrors = false;
 396+# Whether to show "we're sorry, but there has been a database error" pages.
 397+# Displaying errors aids in debugging, but may display information useful
 398+# to an attacker.
 399+$wgShowSQLErrors = false;
401400
402401 # Should [[Category:Dog]] on a page associate it with the
403402 # category "Dog"? (a link to that category page will be
Index: branches/REL1_4/phase3/RELEASE-NOTES
@@ -323,6 +323,8 @@
324324 * (bug 1469) add missing <ul> tags on Special:Log
325325 * (bug 1470) remove extra <ul> tags from Danish log messages
326326 * Fix notice on purge w/ squid mode off
 327+* (bug 1477) hide details of SQL error messages by default
 328+ Set $wgShowSQLErrors = true for debugging.
327329
328330 === Caveats ===
329331

Follow-up revisions

RevisionCommit summaryAuthorDate
r7376* (bug 1477) hide details of SQL error messages by default...vibber05:51, 6 February 2005
r7377* (bug 1477) hide details of SQL error messages by default...vibber06:33, 6 February 2005

Status & tagging log