From: Brian Wolff Date: Wed, 9 Apr 2014 01:55:18 +0000 (-0300) Subject: Make Special:TrackingCategories fully detect namespace switching X-Git-Tag: 1.31.0-rc.0~15342 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin//%22%24encUrl/%22?a=commitdiff_plain;h=adab73ef0275faefbfe158f246059676966f2c05;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 );