Advertisement
Krenair

Bug 45166 fix

Feb 19th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.75 KB | None | 0 0
  1. diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php
  2. index b04f1ef..8645ef4 100644
  3. --- a/includes/specials/SpecialVersion.php
  4. +++ b/includes/specials/SpecialVersion.php
  5. @@ -619,12 +619,13 @@ class SpecialVersion extends SpecialPage {
  6.         /**
  7.          * Convert an array of items into a list for display.
  8.          *
  9. -        * @param $list Array of elements to display
  10. +        * @param $ilist Array of elements to display
  11.          * @param $sort Boolean: whether to sort the items in $list
  12.          *
  13.          * @return String
  14.          */
  15. -       function listToText( $list, $sort = true ) {
  16. +       function listToText( $ilist, $sort = true ) {
  17. +               $list = array_filter( $ilist, function( $entry ) { return !$entry instanceof Closure; } );
  18.                 $cnt = count( $list );
  19.  
  20.                 if ( $cnt == 1 ) {
  21. @@ -636,6 +637,10 @@ class SpecialVersion extends SpecialPage {
  22.                         if ( $sort ) {
  23.                                 sort( $list );
  24.                         }
  25. +                       $closureCount = count( array_filter( $ilist, function( $entry ) { return $entry instanceof Closure; } ) );
  26. +                       if ( $closureCount ) {
  27. +                               $list[] = wfMessage( 'version-extension-functions-anonymous', $closureCount )->text();
  28. +                       }
  29.                         return $this->getLanguage()->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) );
  30.                 }
  31.         }
  32. diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php
  33. index d3f1327..6f95c59 100644
  34. --- a/languages/messages/MessagesEn.php
  35. +++ b/languages/messages/MessagesEn.php
  36. @@ -4727,6 +4727,7 @@ You can also [[Special:EditWatchlist|use the standard editor]].',
  37.  'version-mediahandlers'                 => 'Media handlers',
  38.  'version-hooks'                         => 'Hooks',
  39.  'version-extension-functions'           => 'Extension functions',
  40. +'version-extension-functions-anonymous' => '$1 anonymous {{PLURAL:$1|function|functions}}',
  41.  'version-parser-extensiontags'          => 'Parser extension tags',
  42.  'version-parser-function-hooks'         => 'Parser function hooks',
  43.  'version-hook-name'                     => 'Hook name',
  44. diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php
  45. index 8c26034..9b48998 100644
  46. --- a/languages/messages/MessagesQqq.php
  47. +++ b/languages/messages/MessagesQqq.php
  48. @@ -8243,6 +8243,7 @@ This message is followed by the list of SPAM prevention extensions.',
  49.  There are no such extensions here, so look at [[wikipedia:Special:Version]] for an example.',
  50.  'version-hooks' => 'Shown in [[Special:Version]]',
  51.  'version-extension-functions' => 'Shown in [[Special:Version]]',
  52. +'version-extension-functions-anonymous' => 'Shown in [[Special:Version]] under extension functions to represent functions which do not have names.',
  53.  'version-parser-extensiontags' => 'Part of [[Special:Version]].
  54.  This message is followed by the list of parser extension tags like <code><nowiki><charinsert></nowiki></code>, <code><nowiki><coordinates></nowiki></code>, etc.',
  55.  'version-parser-function-hooks' => 'Shown in [[Special:Version]]',
  56. diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc
  57. index e2997c4..7e74bfe 100644
  58. --- a/maintenance/language/messages.inc
  59. +++ b/maintenance/language/messages.inc
  60. @@ -3588,6 +3588,7 @@ $wgMessageStructure = array(
  61.                 'version-mediahandlers',
  62.                 'version-hooks',
  63.                 'version-extension-functions',
  64. +               'version-extension-functions-anonymous',
  65.                 'version-parser-extensiontags',
  66.                 'version-parser-function-hooks',
  67.                 'version-hook-name',
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement