Old log entries contain titles that used to be valid, but now are not.
Bug: T185049
Change-Id: Ia66d901aedf1b385574b3910b29f020b3fd4bd97
* @param Title|null $title The page
* @param array $parameters Query parameters
* @param string|null $html Linktext of the link as raw html
- * @throws MWException
* @return string
*/
protected function makePageLink( Title $title = null, $parameters = [], $html = null ) {
if ( !$title instanceof Title ) {
- throw new MWException( 'Expected title, got null' );
+ $msg = $this->msg( 'invalidtitle' )->text();
+ if ( !$this->plaintext ) {
+ return Html::element( 'span', [ 'class' => 'mw-invalidtitle' ], $msg );
+ } else {
+ return $msg;
+ }
}
+
if ( !$this->plaintext ) {
$html = $html !== null ? new HtmlArmor( $html ) : $html;
$link = $this->getLinkRenderer()->makeLink( $title, $html, [], $parameters );
"ns-specialprotected": "Special pages cannot be edited.",
"titleprotected": "This title has been protected from creation by [[User:$1|$1]].\nThe reason given is <em>$2</em>.",
"filereadonlyerror": "Unable to modify the file \"$1\" because the file repository \"$2\" is in read-only mode.\n\nThe system administrator who locked it offered this explanation: \"$3\".",
+ "invalidtitle": "Invalid title",
"invalidtitle-knownnamespace": "Invalid title with namespace \"$2\" and text \"$3\"",
"invalidtitle-unknownnamespace": "Invalid title with unknown namespace number $1 and text \"$2\"",
"exception-nologin": "Not logged in",
"ns-specialprotected": "Error message displayed when trying to edit a page in the Special namespace",
"titleprotected": "Used as error message. Parameters:\n* $1 - username; GENDER supported\n* $2 - reason for protection",
"filereadonlyerror": "Parameters:\n* $1 - file name\n* $2 - file repository name\n* $3 - reason",
+ "invalidtitle": "Displayed when an invalid title was encountered (generally in a list) and there are no details about it to be shown.",
"invalidtitle-knownnamespace": "Displayed when an invalid title was encountered (generally in a list), but the namespace number is known to exist.\n\nParameters:\n* $1 - (Unused) the namespace number\n* $2 - the namespace name in content language or {{msg-mw|blanknamespace}} for the main namespace\n* $3 - the part of the title after the namespace (e.g. SomeName for the page User:SomeName)",
"invalidtitle-unknownnamespace": "Displayed when an invalid title was encountered (generally in a list) and the namespace number is unknown.\n\nParameters:\n* $1 - the namespace number\n* $2 - the part of the title after the namespace (e.g. SomeName for the page User:SomeName)",
"exception-nologin": "Generic page title used on error page when a user is not logged in. Message used by the UserNotLoggedIn exception.\n{{Identical|Not logged in}}",