jenkins-bot has submitted this change and it was merged.

Change subject: SpecialRecentchanges: Don't use nonexistent messages for filter 
selector
......................................................................


SpecialRecentchanges: Don't use nonexistent messages for filter selector

Extensions can defined additional filters, but don't need to define
the corresponding messages. If they don't exist, just fall back to
'show' and 'hide'.

This also fixes the double-escaping of selector link contents and adds
missing entries to the list of messages used here.

Follow-up to Ibbfc3cd0.

Bug: 58449
Change-Id: Id323e3b7daced1e7b6b1e1add4e9e1bf7df05e4e
---
M includes/specials/SpecialRecentchanges.php
1 file changed, 12 insertions(+), 7 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index ed29019..f5a5206 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -722,12 +722,6 @@
                        'hidemyself' => 'rcshowhidemine'
                  );
 
-               // The following messages are also used as the link text itself:
-               // rcshowhideminor-show, rcshowhideminor-hide,
-               // rcshowhidebots-show, rcshowhideminor-hide,
-               // rcshowhideanons-show, rcshowhideanons-hide,
-               // rcshowhidepatr-show, rcshowhidepatr-hide,
-               // rcshowhidemine-show, rcshowhidemine-hide.
                $showhide = array( 'show', 'hide' );
 
                foreach ( $this->getCustomFilters() as $key => $params ) {
@@ -740,7 +734,18 @@
 
                $links = array();
                foreach ( $filters as $key => $msg ) {
-                       $link = $this->makeOptionsLink( $this->msg( $msg . '-' 
. $showhide[1 - $options[$key]] ),
+                       // The following messages are used here:
+                       // rcshowhideminor-show, rcshowhideminor-hide, 
rcshowhidebots-show, rcshowhidebots-hide,
+                       // rcshowhideanons-show, rcshowhideanons-hide, 
rcshowhideliu-show, rcshowhideliu-hide,
+                       // rcshowhidepatr-show, rcshowhidepatr-hide, 
rcshowhidemine-show, rcshowhidemine-hide.
+                       $linkMessage = $this->msg( $msg . '-' . $showhide[1 - 
$options[$key]] );
+                       // Extensions can define additional filters, but don't 
need to define the corresponding
+                       // messages. If they don't exist, just fall back to 
'show' and 'hide'.
+                       if ( !$linkMessage->exists() ) {
+                               $linkMessage = $this->msg( $showhide[1 - 
$options[$key]] );
+                       }
+
+                       $link = $this->makeOptionsLink( $linkMessage->text(),
                                array( $key => 1 - $options[$key] ), 
$nondefaults );
                        $links[] = $this->msg( $msg )->rawParams( $link 
)->escaped();
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/116215
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id323e3b7daced1e7b6b1e1add4e9e1bf7df05e4e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.23wmf16
Gerrit-Owner: Hoo man <h...@online.de>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to