Sort languages by code in Language::fetchLanguageNamesUncached
authorMarius Hoch <hoo@online.de>
Sun, 28 Dec 2014 11:51:12 +0000 (12:51 +0100)
committerMarius Hoch <hoo@online.de>
Sun, 28 Dec 2014 12:00:50 +0000 (13:00 +0100)
This is being used in API output in ApiQuerySiteinfo so having
it sorted is nicer.

Bug: T85406
Change-Id: I796112187d17337a1cc12d6752839263b53f40e1

languages/Language.php

index 01fb986..93c186c 100644 (file)
@@ -911,6 +911,7 @@ class Language {
                }
 
                if ( $include === 'all' ) {
+                       ksort( $names );
                        return $names;
                }
 
@@ -932,9 +933,11 @@ class Language {
                                }
                        }
 
+                       ksort( $namesMwFile );
                        return $namesMwFile;
                }
 
+               ksort( $returnMw );
                # 'mw' option; default if it's not one of the other two options (all/mwfile)
                return $returnMw;
        }