From: Pppery Date: Sun, 3 Dec 2017 03:34:12 +0000 (-0500) Subject: Allow wikilinks in "show/hide " labels on Watchlist and RecentChanges X-Git-Tag: 1.31.0-rc.0~1274^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=7a477b2df2e56a7c51601d092b2eac29d35d4e3e;p=lhc%2Fweb%2Fwiklou.git Allow wikilinks in "show/hide " labels on Watchlist and RecentChanges This is done by treating the messages as wikitext rather than plain text Bug: T142406 Change-Id: I5342b9491df47bbb549e91ebba9d0a8b273a7d17 --- diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index cfc7a85c88..bdca301dba 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -943,7 +943,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $links[] = Html::rawElement( 'span', $attribs, - $this->msg( $msg )->rawParams( $link )->escaped() + $this->msg( $msg )->rawParams( $link )->parse() ); } diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index ff62e9e603..9493663387 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -855,11 +855,12 @@ class SpecialWatchlist extends ChangesListSpecialPage { return Html::rawElement( 'span', $attribs, - Xml::checkLabel( - $this->msg( $message, '' )->text(), - $name, - $name, - (int)$value + // not using Html::checkLabel because that would escape the contents + Html::check( $name, (int)$value, [ 'id' => $name ] ) . Html::rawElement( + 'label', + $attribs + [ 'for' => $name ], + // at beginning to avoid messages with "$1 ..." being parsed as pre tags + $this->msg( $message, '' )->parse() ) ); }