jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/374345 )
Change subject: SpecialRecentchanges: Restore ability to use language links in
'recentchangestext' message
......................................................................
SpecialRecentchanges: Restore ability to use language links in
'recentchangestext' message
Bug: T172461
Change-Id: I7b660c78f410f09815a82810824d56cb7a477280
---
M includes/specials/SpecialRecentchanges.php
1 file changed, 15 insertions(+), 1 deletion(-)
Approvals:
Mattflaschen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/specials/SpecialRecentchanges.php
b/includes/specials/SpecialRecentchanges.php
index 4659b9d..55cdcd3 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -636,7 +636,21 @@
$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(),
--
To view, visit https://gerrit.wikimedia.org/r/374345
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7b660c78f410f09815a82810824d56cb7a477280
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits