From: Bartosz DziewoƄski Date: Mon, 28 Aug 2017 16:12:14 +0000 (+0200) Subject: SpecialRecentchanges: Restore ability to use language links in 'recentchangestext... X-Git-Tag: 1.31.0-rc.0~2264^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24plugin.url%7Cescape%7D?a=commitdiff_plain;h=1b264ecc2ebb9e7b3068ac1e9352b3f5190980dc;p=lhc%2Fweb%2Fwiklou.git SpecialRecentchanges: Restore ability to use language links in 'recentchangestext' message Bug: T172461 Change-Id: I7b660c78f410f09815a82810824d56cb7a477280 --- diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 4659b9d739..55cdcd31ff 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -636,7 +636,21 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $message = $this->msg( 'recentchangestext' )->inContentLanguage(); if ( !$message->isDisabled() ) { - $content = $message->parse(); + // Parse the message in this weird ugly way to preserve the ability to include interlanguage + // links in it (T172461). In the future when T66969 is resolved, perhaps we can just use + // $message->parse() instead. This code is copied from Message::parseText(). + $parserOutput = MessageCache::singleton()->parse( + $message->plain(), + $this->getPageTitle(), + /*linestart*/true, + // Message class sets the interface flag to false when parsing in a language different than + // user language, and this is wiki content language + /*interface*/false, + $wgContLang + ); + $content = $parserOutput->getText(); + // Add only metadata here (including the language links), text is added below + $this->getOutput()->addParserOutputMetadata( $parserOutput ); $langAttributes = [ 'lang' => $wgContLang->getHtmlCode(),