Fix regression introduced in r30117: Don's sort() the author list in
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 6 Feb 2010 01:50:30 +0000 (01:50 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 6 Feb 2010 01:50:30 +0000 (01:50 +0000)
Special:Version

When extensions specify a list of authors they expect them to appear
in Special:Version as they're specified. Sorting lists on
Special:Version as introduced in r30117 makes sense for things like
the names of parser functions, but not authors.

Some extensions give arrays like array("foo", "bar", "others") and
expect output like "foo, bar and others". Sometimes (like in the case
of Maps.php) this would only incidentally work.

Furthermore in some cases the first author in the array indicates the
primary author, this is the case with CheckUser.php and other similar
extensions with multiple authors.

RELEASE-NOTES
includes/specials/SpecialVersion.php

index 1aa4a25..b2e221b 100644 (file)
@@ -741,6 +741,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 21593) Special:UserRights now lists automatic groups membership
 * (bug 22364) Setting $wgUseExternalEditor to false no longer hides the reupload
   link from file pages
+* Fix bug introduced in MediaWiki 1.12: The author field in
+  $wgExtensionCredits is no longer sorted with sort() but rather used
+  as it appears in extensions as was the case before r30117 where it
+  was unintentionally sorted along with other fields.
 
 == API changes in 1.16 ==
 
index 06a7254..7da6023 100644 (file)
@@ -307,7 +307,7 @@ class SpecialVersion extends SpecialPage {
                }
                $author = isset ( $extension['author'] ) ? $extension['author'] : array();
                $extDescAuthor = "<td>$description</td>
-                       <td>" . $this->listToText( (array)$author ) . "</td>
+                       <td>" . $this->listToText( (array)$author, false ) . "</td>
                        </tr>\n";
                return $extNameVer . $extDescAuthor;
        }
@@ -369,9 +369,10 @@ class SpecialVersion extends SpecialPage {
 
        /**
         * @param array $list
+        * @param bool $sort
         * @return string
         */
-       function listToText( $list ) {
+       function listToText( $list, $sort = true ) {
                $cnt = count( $list );
 
                if ( $cnt == 1 ) {
@@ -381,7 +382,9 @@ class SpecialVersion extends SpecialPage {
                        return '';
                } else {
                        global $wgLang;
-                       sort( $list );
+                       if ( $sort ) {
+                               sort( $list );
+                       }
                        return $wgLang->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) );
                }
        }