API: Don't unstub $wgContLang in ApiBase::getValidNamespaces()
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 26 Feb 2010 18:24:58 +0000 (18:24 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 26 Feb 2010 18:24:58 +0000 (18:24 +0000)
includes/api/ApiBase.php

index 39205bd..419d64c 100644 (file)
@@ -521,10 +521,10 @@ abstract class ApiBase {
                static $mValidNamespaces = null;
 
                if ( is_null( $mValidNamespaces ) ) {
-                       global $wgContLang;
-                       $mValidNamespaces = array();
-                       foreach ( array_keys( $wgContLang->getNamespaces() ) as $ns ) {
-                               if ( $ns >= 0 ) {
+                       global $wgCanonicalNamespaceNames;
+                       $mValidNamespaces = array( NS_MAIN ); // Doesn't appear in $wgCanonicalNamespaceNames for some reason
+                       foreach ( array_keys( $wgCanonicalNamespaceNames ) as $ns ) {
+                               if ( $ns > 0 ) {
                                        $mValidNamespaces[] = $ns;
                                }
                        }