function report() {
global $wgOut;
- if ( $wgOut->getTitle() ) {
- $wgOut->debug( 'Original title: ' . $wgOut->getTitle()->getPrefixedText() . "\n" );
- }
- $wgOut->setPageTitle( wfMsg( $this->title ) );
- $wgOut->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
- $wgOut->setRobotPolicy( 'noindex,nofollow' );
- $wgOut->setArticleRelated( false );
- $wgOut->enableClientCache( false );
- $wgOut->mRedirect = '';
- $wgOut->clearHTML();
-
- if( $this->msg instanceof Message ){
- $wgOut->addHTML( $this->msg->parse() );
- } else {
- $wgOut->addWikiMsgArray( $this->msg, $this->params );
- }
-
- $wgOut->returnToMain();
+ $wgOut->showErrorPage( $this->title, $this->msg, $this->params );
$wgOut->output();
}
}
/**
* Output a standard error page
*
+ * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) );
+ * showErrorPage( 'titlemsg', $messageObject );
+ *
* @param $title String: message key for page title
- * @param $msg String: message key for page text
- * @param $params Array: message parameters
+ * @param $msg Mixed: message key (string) for page text, or a Message object
+ * @param $params Array: message parameters; ignored if $msg is a Message object
*/
public function showErrorPage( $title, $msg, $params = array() ) {
if ( $this->getTitle() ) {
$this->mRedirect = '';
$this->mBodytext = '';
- $this->addWikiMsgArray( $msg, $params );
+ if ( $msg instanceof Message ){
+ $wgOut->addHTML( $msg->parse() );
+ } else {
+ $wgOut->addWikiMsgArray( $msg, $params );
+ }
$this->returnToMain();
}