X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=includes%2FTrackingCategories.php;h=d9e185ef1fd1a66d33786a64d6549e7c3a81bb83;hb=223b7a3717526682316a314f1cfa2a56ecac45b3;hp=825860a5a9801466e19430143a3cff4a7f0de4c6;hpb=0f0ba2132f9cfc6b37d89c93ea2bcd4e07aa7dbe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/TrackingCategories.php b/includes/TrackingCategories.php index 825860a5a9..d9e185ef1f 100644 --- a/includes/TrackingCategories.php +++ b/includes/TrackingCategories.php @@ -19,9 +19,12 @@ * @ingroup Categories */ +use MediaWiki\MediaWikiServices; + /** * This class performs some operations related to tracking categories, such as creating * a list of all such categories. + * @since 1.29 */ class TrackingCategories { /** @var Config */ @@ -45,6 +48,7 @@ class TrackingCategories { 'expansion-depth-exceeded-category', 'restricted-displaytitle-ignored', 'deprecated-self-close-category', + 'template-loop-category', ]; /** @@ -56,7 +60,7 @@ class TrackingCategories { /** * Read the global and extract title objects from the corresponding messages - * @return array Array( 'msg' => Title, 'cats' => Title[] ) + * @return array [ 'msg' => Title, 'cats' => Title[] ] */ public function getTrackingCategories() { $categories = array_merge( @@ -78,6 +82,7 @@ class TrackingCategories { } $trackingCategories = []; + $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo(); foreach ( $categories as $catMsg ) { /* * Check if the tracking category varies by namespace @@ -94,7 +99,7 @@ class TrackingCategories { // Match things like {{NAMESPACE}} and {{NAMESPACENUMBER}}. // False positives are ok, this is just an efficiency shortcut if ( strpos( $msgObj->plain(), '{{' ) !== false ) { - $ns = MWNamespace::getValidNamespaces(); + $ns = $nsInfo->getValidNamespaces(); foreach ( $ns as $namesp ) { $tempTitle = Title::makeTitleSafe( $namesp, $catMsg ); if ( !$tempTitle ) {