Fix assingment in conditionals
authorSam Reed <reedy@users.mediawiki.org>
Mon, 19 Sep 2011 13:47:15 +0000 (13:47 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 19 Sep 2011 13:47:15 +0000 (13:47 +0000)
Remove unused globals/variables

languages/Language.php

index 8e7cc65..ca9782d 100644 (file)
@@ -514,7 +514,6 @@ class Language {
                return $this->mNamespaceIds;
        }
 
-
        /**
         * Get a namespace key by value, case insensitive.  Canonical namespace
         * names override custom ones defined for the current language.
@@ -524,7 +523,8 @@ class Language {
         */
        function getNsIndex( $text ) {
                $lctext = $this->lc( $text );
-               if ( ( $ns = MWNamespace::getCanonicalIndex( $lctext ) ) !== null ) {
+               $ns = MWNamespace::getCanonicalIndex( $lctext );
+               if ( $ns !== null ) {
                        return $ns;
                }
                $ids = $this->getNamespaceIds();
@@ -543,7 +543,9 @@ class Language {
                list( $rootCode ) = explode( '-', $code );
                if( $usemsg && wfMessage( $msg )->exists() ) {
                        return $this->getMessageFromDB( $msg );
-               } elseif( $name = self::getLanguageName( $code ) ) {
+               }
+               $name = self::getLanguageName( $code );
+               if( $name ) {
                        return $name; # if it's defined as a language name, show that
                } else {
                        # otherwise, output the language code