Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/209303

Change subject: MalformedTitleException should call parent::__construct
......................................................................

MalformedTitleException should call parent::__construct

There's no reason for $ex->getMessage() to return nothing. Do like
ErrorPageError does and get the default English message for the parent.

Change-Id: I43d988602b847b67a3cf0aa84e271a0b5bd9adae
---
M includes/title/MalformedTitleException.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/209303/1

diff --git a/includes/title/MalformedTitleException.php 
b/includes/title/MalformedTitleException.php
index e747778..98dba88 100644
--- a/includes/title/MalformedTitleException.php
+++ b/includes/title/MalformedTitleException.php
@@ -36,6 +36,10 @@
                $this->errorMessage = $errorMessage;
                $this->titleText = $titleText;
                $this->errorMessageParameters = $errorMessageParameters;
+
+               $enMsg = wfMessage( $errorMessage, $errorMessageParameters );
+               $enMsg->inLanguage( 'en' )->useDatabase( false );
+               parent::__construct( $enMsg->text() );
        }
 
        /**
@@ -45,7 +49,7 @@
        public function getTitleText() {
                return $this->titleText;
        }
-       
+
        /**
         * @since 1.26
         * @return string|null
@@ -53,7 +57,7 @@
        public function getErrorMessage() {
                return $this->errorMessage;
        }
-       
+
        /**
         * @since 1.26
         * @return string[]

-- 
To view, visit https://gerrit.wikimedia.org/r/209303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43d988602b847b67a3cf0aa84e271a0b5bd9adae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to