From 24306ea99bb86dc9e8e6a6ae88d8fc0697df5c6d Mon Sep 17 00:00:00 2001 From: Tyler Anthony Romeo Date: Mon, 6 Aug 2012 17:07:24 -0400 Subject: [PATCH] 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 --- includes/OutputPage.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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() ); -- 2.20.1