Index: trunk/phase3/includes/Exception.php |
— | — | @@ -324,13 +324,35 @@ |
325 | 325 | $this->title = $title; |
326 | 326 | $this->msg = $msg; |
327 | 327 | $this->params = $params; |
328 | | - parent::__construct( wfMsg( $msg ) ); |
| 328 | + |
| 329 | + if( $msg instanceof Message ){ |
| 330 | + parent::__construct( $msg ); |
| 331 | + } else { |
| 332 | + parent::__construct( wfMsg( $msg ) ); |
| 333 | + } |
329 | 334 | } |
330 | 335 | |
331 | 336 | function report() { |
332 | 337 | global $wgOut; |
333 | 338 | |
334 | | - $wgOut->showErrorPage( $this->title, $this->msg, $this->params ); |
| 339 | + if ( $wgOut->getTitle() ) { |
| 340 | + $wgOut->debug( 'Original title: ' . $wgOut->getTitle()->getPrefixedText() . "\n" ); |
| 341 | + } |
| 342 | + $wgOut->setPageTitle( wfMsg( $this->title ) ); |
| 343 | + $wgOut->setHTMLTitle( wfMsg( 'errorpagetitle' ) ); |
| 344 | + $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
| 345 | + $wgOut->setArticleRelated( false ); |
| 346 | + $wgOut->enableClientCache( false ); |
| 347 | + $wgOut->mRedirect = ''; |
| 348 | + $wgOut->clearHTML(); |
| 349 | + |
| 350 | + if( $this->msg instanceof Message ){ |
| 351 | + $wgOut->addHTML( $this->msg->parse() ); |
| 352 | + } else { |
| 353 | + $wgOut->addWikiMsgArray( $this->msg, $this->params ); |
| 354 | + } |
| 355 | + |
| 356 | + $wgOut->returnToMain(); |
335 | 357 | $wgOut->output(); |
336 | 358 | } |
337 | 359 | } |