Merge "Add NS_MAIN to NamespaceInfo::$canonicalNames"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 4 Sep 2019 17:03:24 +0000 (17:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 4 Sep 2019 17:03:24 +0000 (17:03 +0000)
1  2 
includes/title/NamespaceInfo.php

@@@ -62,6 -62,7 +62,7 @@@ class NamespaceInfo 
        public static $canonicalNames = [
                NS_MEDIA            => 'Media',
                NS_SPECIAL          => 'Special',
+               NS_MAIN             => '',
                NS_TALK             => 'Talk',
                NS_USER             => 'User',
                NS_USER_TALK        => 'User_talk',
         * Returns array of all defined namespaces with their canonical
         * (English) names.
         *
 -       * @return array
 +       * @return string[]
         */
        public function getCanonicalNamespaces() {
                if ( $this->canonicalNamespaces === null ) {
         */
        public function getValidNamespaces() {
                if ( is_null( $this->validNamespaces ) ) {
 +                      $this->validNamespaces = [];
                        foreach ( array_keys( $this->getCanonicalNamespaces() ) as $ns ) {
                                if ( $ns >= 0 ) {
                                        $this->validNamespaces[] = $ns;