From 2578bb06a860afa5c6b9ae9209e0e72b8be30c31 Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Wed, 6 Feb 2013 11:53:10 +0100 Subject: [PATCH] Extend ... magic to also work when "others" is linked somewhere Change-Id: I8c6657c95061b066ed48f115e771889a507bd268 --- RELEASE-NOTES-1.21 | 2 ++ includes/DefaultSettings.php | 5 +++++ includes/specials/SpecialVersion.php | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 2db9153c91..51259de97b 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -85,6 +85,8 @@ production. in MW 1.20 (saving preferences using Special:Preferences cleared any additional fields) and which has been disabled in 1.20.1 as a part of a security fix (bug 42202). +* Added option to specify "others" as author in extension credits using + "..." as author name. * Added the ability to limit the wall clock time used by shell processes, as well as the CPU time. Configurable with $wgMaxShellWallClockTime. * Allow memory of shell subprocesses to be limited using Linux cgroups diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 731c1a1da1..e33c6c0a30 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5464,6 +5464,11 @@ $wgAutoloadClasses = array(); * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'. * Where 'descriptionmsg' can be an array with message key and parameters: * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ), + * + * author can be a string or an array of strings. Authors can be linked using + * the regular wikitext link syntax. To have an internationalized version of + * "and others" show, add an element "...". This element can also be linked, + * for instance "[http://example ...]". */ $wgExtensionCredits = array(); diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 88d647e92b..f847ca37a0 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -606,8 +606,10 @@ class SpecialVersion extends SpecialPage { function listAuthors( $authors ) { $list = array(); foreach( (array)$authors as $item ) { - if( $item == '...' ) { + if ( $item == '...' ) { $list[] = $this->msg( 'version-poweredby-others' )->text(); + } elseif ( substr( $item, -5 ) == ' ...]' ) { + $list[] = substr( $item, 0, -4 ) . $this->msg( 'version-poweredby-others' )->text() . "]"; } else { $list[] = $item; } -- 2.20.1