Index: branches/REL1_4/phase3/includes/SpecialSitesettings.php |
— | — | @@ -170,7 +170,6 @@ |
171 | 171 | $this->checkbox( 'wgDebugComments' ) . |
172 | 172 | $this->checkbox( 'wgLogQueries' ) . |
173 | 173 | $this->checkbox( 'wgDebugDumpSql' ) . |
174 | | - $this->checkbox( 'wgIgnoreSQLErrors' ) . |
175 | 174 | $this->fieldset( 'sitesettings-debugging-profiling', |
176 | 175 | $this->checkbox( 'wgProfiling' ) . |
177 | 176 | $this->textbox( 'wgProfileLimit' ) . |
Index: branches/REL1_4/phase3/includes/OutputPage.php |
— | — | @@ -581,7 +581,7 @@ |
582 | 582 | } |
583 | 583 | |
584 | 584 | function databaseError( $fname, $sql, $error, $errno ) { |
585 | | - global $wgUser, $wgCommandLineMode; |
| 585 | + global $wgUser, $wgCommandLineMode, $wgShowSQLErrors; |
586 | 586 | |
587 | 587 | $this->setPageTitle( wfMsgNoDB( 'databaseerror' ) ); |
588 | 588 | $this->setRobotpolicy( 'noindex,nofollow' ); |
— | — | @@ -589,12 +589,20 @@ |
590 | 590 | $this->enableClientCache( false ); |
591 | 591 | $this->mRedirect = ''; |
592 | 592 | |
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 | + } |
596 | 601 | } 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 | + } |
599 | 607 | } |
600 | 608 | |
601 | 609 | if ( $wgCommandLineMode || !is_object( $wgUser )) { |
Index: branches/REL1_4/phase3/includes/DefaultSettings.php |
— | — | @@ -271,8 +271,6 @@ |
272 | 272 | $wgDBmysql4 = false; # Set to true to use enhanced fulltext search |
273 | 273 | $wgSqlTimeout = 30; |
274 | 274 | |
275 | | -$wgBufferSQLResults = true; # use buffered queries by default |
276 | | - |
277 | 275 | # Other wikis on this site, can be administered from a single developer account |
278 | 276 | # Array, interwiki prefix => database name |
279 | 277 | $wgLocalDatabases = array(); |
— | — | @@ -394,9 +392,10 @@ |
395 | 393 | $wgLogQueries = false; |
396 | 394 | $wgDebugDumpSql = false; |
397 | 395 | |
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; |
401 | 400 | |
402 | 401 | # Should [[Category:Dog]] on a page associate it with the |
403 | 402 | # category "Dog"? (a link to that category page will be |
Index: branches/REL1_4/phase3/RELEASE-NOTES |
— | — | @@ -323,6 +323,8 @@ |
324 | 324 | * (bug 1469) add missing <ul> tags on Special:Log |
325 | 325 | * (bug 1470) remove extra <ul> tags from Danish log messages |
326 | 326 | * 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. |
327 | 329 | |
328 | 330 | === Caveats === |
329 | 331 | |