Index: trunk/phase3/includes/Exception.php |
— | — | @@ -283,7 +283,16 @@ |
284 | 284 | } |
285 | 285 | } |
286 | 286 | } 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 | + } |
288 | 297 | } |
289 | 298 | } |
290 | 299 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -344,7 +344,10 @@ |
345 | 345 | * (bug 5530) Consistency between character encoding in {{PAGENAMEE}}, |
346 | 346 | {{SUBPAGENAMEE}} and {{FULLPAGENAMEE}} |
347 | 347 | * 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. |
348 | 350 | |
| 351 | + |
349 | 352 | === API changes in 1.14 === |
350 | 353 | |
351 | 354 | * Registration time of users registered before the DB field was created is now |