From: Ævar Arnfjörð Bjarmason Date: Sat, 6 Feb 2010 01:50:30 +0000 (+0000) Subject: Fix regression introduced in r30117: Don's sort() the author list in X-Git-Tag: 1.31.0-rc.0~37907 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=3fcec28299dcd713c73c50ae8e54db98c2a91c68;p=lhc%2Fweb%2Fwiklou.git Fix regression introduced in r30117: Don's sort() the author list in 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. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1aa4a2509c..b2e221bbcd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 06a725492b..7da6023ed8 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -307,7 +307,7 @@ class SpecialVersion extends SpecialPage { } $author = isset ( $extension['author'] ) ? $extension['author'] : array(); $extDescAuthor = "$description - " . $this->listToText( (array)$author ) . " + " . $this->listToText( (array)$author, false ) . " \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 ) ); } }