From: Roan Kattouw Date: Fri, 26 Feb 2010 18:24:58 +0000 (+0000) Subject: API: Don't unstub $wgContLang in ApiBase::getValidNamespaces() X-Git-Tag: 1.31.0-rc.0~37594 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=d0045bcd78de72be86fe637afec6d2c03dc4461d;p=lhc%2Fweb%2Fwiklou.git API: Don't unstub $wgContLang in ApiBase::getValidNamespaces() --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 39205bdce2..419d64cccd 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -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; } }