| Index: trunk/phase3/includes/Exception.php |
| — | — | @@ -255,24 +255,7 @@ |
| 256 | 256 | function report() { |
| 257 | 257 | global $wgOut; |
| 258 | 258 | |
| 259 | | - if ( $wgOut->getTitle() ) { |
| 260 | | - $wgOut->debug( 'Original title: ' . $wgOut->getTitle()->getPrefixedText() . "\n" ); |
| 261 | | - } |
| 262 | | - $wgOut->setPageTitle( wfMsg( $this->title ) ); |
| 263 | | - $wgOut->setHTMLTitle( wfMsg( 'errorpagetitle' ) ); |
| 264 | | - $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
| 265 | | - $wgOut->setArticleRelated( false ); |
| 266 | | - $wgOut->enableClientCache( false ); |
| 267 | | - $wgOut->mRedirect = ''; |
| 268 | | - $wgOut->clearHTML(); |
| 269 | | - |
| 270 | | - if( $this->msg instanceof Message ){ |
| 271 | | - $wgOut->addHTML( $this->msg->parse() ); |
| 272 | | - } else { |
| 273 | | - $wgOut->addWikiMsgArray( $this->msg, $this->params ); |
| 274 | | - } |
| 275 | | - |
| 276 | | - $wgOut->returnToMain(); |
| | 259 | + $wgOut->showErrorPage( $this->title, $this->msg, $this->params ); |
| 277 | 260 | $wgOut->output(); |
| 278 | 261 | } |
| 279 | 262 | } |
| Index: trunk/phase3/includes/OutputPage.php |
| — | — | @@ -1893,9 +1893,12 @@ |
| 1894 | 1894 | /** |
| 1895 | 1895 | * Output a standard error page |
| 1896 | 1896 | * |
| | 1897 | + * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) ); |
| | 1898 | + * showErrorPage( 'titlemsg', $messageObject ); |
| | 1899 | + * |
| 1897 | 1900 | * @param $title String: message key for page title |
| 1898 | | - * @param $msg String: message key for page text |
| 1899 | | - * @param $params Array: message parameters |
| | 1901 | + * @param $msg Mixed: message key (string) for page text, or a Message object |
| | 1902 | + * @param $params Array: message parameters; ignored if $msg is a Message object |
| 1900 | 1903 | */ |
| 1901 | 1904 | public function showErrorPage( $title, $msg, $params = array() ) { |
| 1902 | 1905 | if ( $this->getTitle() ) { |
| — | — | @@ -1909,7 +1912,11 @@ |
| 1910 | 1913 | $this->mRedirect = ''; |
| 1911 | 1914 | $this->mBodytext = ''; |
| 1912 | 1915 | |
| 1913 | | - $this->addWikiMsgArray( $msg, $params ); |
| | 1916 | + if ( $msg instanceof Message ){ |
| | 1917 | + $wgOut->addHTML( $msg->parse() ); |
| | 1918 | + } else { |
| | 1919 | + $wgOut->addWikiMsgArray( $msg, $params ); |
| | 1920 | + } |
| 1914 | 1921 | |
| 1915 | 1922 | $this->returnToMain(); |
| 1916 | 1923 | } |