Make Special:TrackingCategories fully detect namespace switching
authorBrian Wolff <bawolff+wn@gmail.com>
Wed, 9 Apr 2014 01:55:18 +0000 (22:55 -0300)
committerReedy <reedy@wikimedia.org>
Thu, 19 Jun 2014 09:23:16 +0000 (09:23 +0000)
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

index 8a32ba9..98e92e4 100644 (file)
@@ -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 );