diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /includes/exception/BadTitleError.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/exception/BadTitleError.php')
-rw-r--r-- | includes/exception/BadTitleError.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/exception/BadTitleError.php b/includes/exception/BadTitleError.php index e62f8bd6..039b9c60 100644 --- a/includes/exception/BadTitleError.php +++ b/includes/exception/BadTitleError.php @@ -28,11 +28,22 @@ */ class BadTitleError extends ErrorPageError { /** - * @param string|Message $msg A message key (default: 'badtitletext') + * @param string|Message|MalformedTitleException $msg A message key (default: 'badtitletext'), or + * a MalformedTitleException to figure out things from * @param array $params Parameter to wfMessage() */ public function __construct( $msg = 'badtitletext', $params = array() ) { - parent::__construct( 'badtitle', $msg, $params ); + if ( $msg instanceof MalformedTitleException ) { + $errorMessage = $msg->getErrorMessage(); + if ( !$errorMessage ) { + parent::__construct( 'badtitle', 'badtitletext', array() ); + } else { + $errorMessageParams = $msg->getErrorMessageParameters(); + parent::__construct( 'badtitle', $errorMessage, $errorMessageParams ); + } + } else { + parent::__construct( 'badtitle', $msg, $params ); + } } /** @@ -47,5 +58,4 @@ class BadTitleError extends ErrorPageError { $wgOut->setStatusCode( 400 ); parent::report(); } - } |