r36632 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36631‎ | r36632 | r36633 >
Date:11:23, 25 June 2008
Author:nikerabbit
Status:old
Tags:
Comment:
* Handle fallbacks too in extension aliases
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -1740,25 +1740,19 @@
17411741 if ( !isset($aliases['en']) )
17421742 throw new MWException( 'Malformed aliases file' );
17431743
 1744+ // Merge all aliases in fallback chain
17441745 $code = $this->getCode();
 1746+ do {
 1747+ if ( !isset($aliases[$code]) ) continue;
17451748
1746 - if ( isset($aliases[$code]) ) {
17471749 $aliases[$code] = $this->fixSpecialPageAliases( $aliases[$code] );
17481750 /* Merge the aliases, THIS will break if there is special page name
17491751 * which looks like a numerical key, thanks to PHP...
17501752 * See the comments for wfArrayMerge in GlobalSettings.php. */
17511753 $this->mExtendedSpecialPageAliases = array_merge_recursive(
17521754 $this->mExtendedSpecialPageAliases, $aliases[$code] );
1753 - }
17541755
1755 - /* Add the English aliases to the end of list as aliases... unless we
1756 - * already added them! */
1757 - if ( $code !== 'en' ) {
1758 - $aliases['en'] = $this->fixSpecialPageAliases( $aliases['en'] );
1759 - $this->mExtendedSpecialPageAliases = array_merge_recursive(
1760 - $this->mExtendedSpecialPageAliases, $aliases['en'] );
1761 - }
1762 -
 1756+ } while ( $code = self::getFallbackFor( $code ) );
17631757 }
17641758
17651759 wfRunHooks( 'LanguageGetSpecialPageAliases',

Status & tagging log