From adab73ef0275faefbfe158f246059676966f2c05 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Tue, 8 Apr 2014 22:55:18 -0300 Subject: [PATCH] Make Special:TrackingCategories fully detect namespace switching Special:TrackingCategories has special logic to detect people using {{NAMESPACE}} in their tracking category messages, and handle it. Make it detect any '{{' to deal with localized variants. This will make it work for [[commons:MediaWiki:Broken-file-category]] Change-Id: Ibac0decc5992d30ae536efc91138ad9b42a569e9 --- includes/specials/SpecialTrackingCategories.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialTrackingCategories.php b/includes/specials/SpecialTrackingCategories.php index 8a32ba98da..98e92e4000 100644 --- a/includes/specials/SpecialTrackingCategories.php +++ b/includes/specials/SpecialTrackingCategories.php @@ -74,7 +74,9 @@ class SpecialTrackingCategories extends SpecialPage { htmlspecialchars( $catMsg ) ); - if ( strpos( $msgObj->plain(), '{{NAMESPACE}}' ) !== false ) { + // Match things like {{NAMESPACE}} and {{NAMESPACENUMBER}}. + // False positives are ok, this is just an efficiency shortcut + if ( strpos( $msgObj->plain(), '{{' ) !== false ) { $ns = MWNamespace::getValidNamespaces(); foreach ( $ns as $namesp ) { $tempTitle = Title::makeTitleSafe( $namesp, $catMsg ); -- 2.20.1