X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/title/MalformedTitleException.php diff --git a/includes/title/MalformedTitleException.php b/includes/title/MalformedTitleException.php new file mode 100644 index 00000000..213343f9 --- /dev/null +++ b/includes/title/MalformedTitleException.php @@ -0,0 +1,83 @@ +errorMessage = $errorMessage; + $this->titleText = $titleText; + if ( $titleText !== null ) { + $errorMessageParameters[] = $titleText; + } + $this->errorMessageParameters = $errorMessageParameters; + + // Supply something useful for Exception::getMessage() to return. + $enMsg = wfMessage( $errorMessage, $errorMessageParameters ); + $enMsg->inLanguage( 'en' )->useDatabase( false ); + parent::__construct( $enMsg->text() ); + } + + /** + * @since 1.26 + * @return string|null + */ + public function getTitleText() { + return $this->titleText; + } + + /** + * @since 1.26 + * @return string + */ + public function getErrorMessage() { + return $this->errorMessage; + } + + /** + * @since 1.26 + * @return string[] + */ + public function getErrorMessageParameters() { + return $this->errorMessageParameters; + } + + /** + * @since 1.29 + * @return Message + */ + public function getMessageObject() { + return wfMessage( $this->getErrorMessage(), $this->getErrorMessageParameters() ); + } +}