X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTrackingCategories.php;h=d9e185ef1fd1a66d33786a64d6549e7c3a81bb83;hb=9ce26a564d066a33ba7ae2a6502e3d57e7e4d48b;hp=a9ebd762db4eb832ac6f4797f2c1cb1feea9eec6;hpb=d42d6bd868fd5b579080639995e6a7e23851fcf3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/TrackingCategories.php b/includes/TrackingCategories.php index a9ebd762db..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 */ @@ -57,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( @@ -79,6 +82,7 @@ class TrackingCategories { } $trackingCategories = []; + $nsInfo = MediaWikiServices::getInstance()->getNamespaceInfo(); foreach ( $categories as $catMsg ) { /* * Check if the tracking category varies by namespace @@ -95,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 ) {