Allow wikilinks in "show/hide <type of change>" labels on Watchlist and RecentChanges
authorPppery <mapreader@olum.org>
Sun, 3 Dec 2017 03:34:12 +0000 (22:34 -0500)
committerPppery <mapreader@olum.org>
Mon, 4 Dec 2017 20:01:26 +0000 (15:01 -0500)
This is done by treating the messages as wikitext rather than plain
text

Bug: T142406
Change-Id: I5342b9491df47bbb549e91ebba9d0a8b273a7d17

includes/specials/SpecialRecentchanges.php
includes/specials/SpecialWatchlist.php

index cfc7a85..bdca301 100644 (file)
@@ -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()
                        );
                }
 
index ff62e9e..9493663 100644 (file)
@@ -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 ],
+                               // <nowiki/> at beginning to avoid messages with "$1 ..." being parsed as pre tags
+                               $this->msg( $message, '<nowiki/>' )->parse()
                        )
                );
        }