r43621 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43620‎ | r43621 | r43622 >
Date:18:51, 17 November 2008
Author:brion
Status:ok
Tags:
Comment:
* Safer handling of non-MediaWiki exceptions -- now obeys our settings for formatting and path exposure.

Applying Tim's fixes...
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Exception.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exception.php
@@ -283,7 +283,16 @@
284284 }
285285 }
286286 } else {
287 - echo $e->__toString();
 287+ $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" .
 288+ $e->__toString() . "\n";
 289+ if ( $GLOBALS['wgShowExceptionDetails'] ) {
 290+ $message .= "\n" . $e->getTraceAsString() ."\n";
 291+ }
 292+ if ( !empty( $GLOBALS['wgCommandLineMode'] ) ) {
 293+ wfPrintError( $message );
 294+ } else {
 295+ echo nl2br( htmlspecialchars( $message ) ). "\n";
 296+ }
288297 }
289298 }
290299
Index: trunk/phase3/RELEASE-NOTES
@@ -344,7 +344,10 @@
345345 * (bug 5530) Consistency between character encoding in {{PAGENAMEE}},
346346 {{SUBPAGENAMEE}} and {{FULLPAGENAMEE}}
347347 * API siteinfo query no longer throws an exception for empty sifilter parameter.
 348+* Safer handling of non-MediaWiki exceptions -- now obeys our settings for
 349+ formatting and path exposure.
348350
 351+
349352 === API changes in 1.14 ===
350353
351354 * Registration time of users registered before the DB field was created is now

Follow-up revisions

RevisionCommit summaryAuthorDate
r43669Backported r43621, r43622, r43623, r43624, r43625, r43627, r43660, r43661. Ne...tstarling11:36, 18 November 2008

Status & tagging log