From: Tyler Anthony Romeo Date: Mon, 6 Aug 2012 21:07:24 +0000 (-0400) Subject: Allowing Message objects to be passed as error page title. X-Git-Tag: 1.31.0-rc.0~22821^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=24306ea99bb86dc9e8e6a6ae88d8fc0697df5c6d;p=lhc%2Fweb%2Fwiklou.git Allowing Message objects to be passed as error page title. Changed OutputPage::showErrorPage() so that the title parameter can be either a string or a Message object, just like the message parameter. This allows titles that take parameters. Change-Id: Icb7f7b0db8599984774f438333b60d66956b6075 Signed-off-by: Tyler Anthony Romeo --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index bf70467cfd..6c1ac4bd10 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2053,13 +2053,18 @@ class OutputPage extends ContextSource { * * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) ); * showErrorPage( 'titlemsg', $messageObject ); + * showErrorPage( $titleMessageObj, $messageObject ); * - * @param $title String: message key for page title + * @param $title Mixed: message key (string) for page title, or a Message object * @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() ) { - $this->prepareErrorPage( $this->msg( $title ), $this->msg( 'errorpagetitle' ) ); + if( !$title instanceof Message ) { + $title = $this->msg( $title ); + } + + $this->prepareErrorPage( $title, $this->msg( 'errorpagetitle' ) ); if ( $msg instanceof Message ){ $this->addHTML( $msg->parse() );