r112301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112300‎ | r112301 | r112302 >
Date:05:16, 24 February 2012
Author:tstarling
Status:ok
Tags:
Comment:
MFT r112300: fallback infinite loops
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/LandingCheck/SpecialLandingCheck.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/SecurePoll/includes/pages/Page.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -1694,12 +1694,14 @@
16951695
16961696 switch ( $type ) {
16971697 case 'request':
1698 - $count = 0;
1699 - //Count's just there making sure we don't get stuck here.
1700 - while ( !in_array( $language, $this->getAvailableLanguages() ) && $count < 3 ){
1701 - // Get the fallback language
1702 - $language = Language::getFallbackFor( $language );
1703 - $count += 1;
 1698+ if ( !in_array( $language, $this->getAvailableLanguages() ) ) {
 1699+ $fallbacks = Language::getFallbacksFor( $language );
 1700+ foreach ( $fallbacks as $fallback ) {
 1701+ if ( in_array( $fallback, $this->getAvailableLanguages() ) ) {
 1702+ $language = $fallback;
 1703+ break;
 1704+ }
 1705+ }
17041706 }
17051707
17061708 if ( !in_array( $language, $this->getAvailableLanguages() ) ){
Property changes on: branches/wmf/1.19wmf1/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
___________________________________________________________________
Added: svn:mergeinfo
17071709 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112153,112160,112166,112260,112282,112300
17081710 Merged /branches/sqlite/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r58211-58321
17091711 Merged /trunk/phase3/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
17101712 Merged /branches/new-installer/phase3/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r43664-66004
17111713 Merged /branches/JSTesting/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r100352-107913
17121714 Merged /branches/REL1_15/phase3/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r51646
17131715 Merged /branches/wmf/1.18wmf1/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r97508
17141716 Merged /branches/REL1_17/phase3/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r81445,81448
Index: branches/wmf/1.19wmf1/extensions/SecurePoll/includes/pages/Page.php
@@ -38,16 +38,14 @@
3939 }
4040 $wgLang = Language::factory( $userLang );
4141
42 - $languages = array( $userLang );
43 - $fallback = $userLang;
44 - while ( $fallback = Language::getFallbackFor( $fallback ) ) {
45 - $languages[] = $fallback;
 42+ $languages = array_merge(
 43+ array( $userLang ),
 44+ Language::getFallbacksFor( $userLang ) );
 45+
 46+ if ( !in_array( $election->getLanguage(), $languages ) ) {
 47+ $languages[] = $election->getLanguage();
4648 }
47 - if ( $fallback != $election->getLanguage() ) {
48 - $fallback = $election->getLanguage();
49 - $languages[] = $fallback;
50 - }
51 - if ( $fallback != 'en' ) {
 49+ if ( !in_array( 'en', $languages ) ) {
5250 $languages[] = 'en';
5351 }
5452 $this->context->setLanguages( $languages );
Property changes on: branches/wmf/1.19wmf1/extensions/SecurePoll/includes/pages/Page.php
___________________________________________________________________
Added: svn:mergeinfo
5553 Merged /branches/JSTesting/extensions/SecurePoll/includes/pages/Page.php:r100352-107913
5654 Merged /branches/REL1_15/phase3/extensions/SecurePoll/includes/pages/Page.php:r51646
5755 Merged /branches/wmf/1.18wmf1/extensions/SecurePoll/includes/pages/Page.php:r97508
5856 Merged /branches/REL1_17/phase3/extensions/SecurePoll/includes/pages/Page.php:r81445,81448
5957 Merged /trunk/extensions/SecurePoll/includes/pages/Page.php:r111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112153,112160,112166,112260,112282,112300
6058 Merged /branches/sqlite/extensions/SecurePoll/includes/pages/Page.php:r58211-58321
6159 Merged /trunk/phase3/extensions/SecurePoll/includes/pages/Page.php:r111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
6260 Merged /branches/new-installer/phase3/extensions/SecurePoll/includes/pages/Page.php:r43664-66004
Index: branches/wmf/1.19wmf1/extensions/LandingCheck/SpecialLandingCheck.php
@@ -178,10 +178,9 @@
179179 $landingPage . '/' . $language
180180 );
181181 // Add fallback languages
182 - $code = $language;
183 - while ( $code !== 'en' ) {
184 - $code = Language::getFallbackFor( $code );
185 - $targetTexts[] = $landingPage . '/' . $code;
 182+ $fallbacks = Language::getFallbacksFor( $language );
 183+ foreach ( $fallbacks as $fallback ) {
 184+ $targetTexts[] = $landingPage . '/' . $fallback;
186185 }
187186 }
188187
Property changes on: branches/wmf/1.19wmf1/extensions/LandingCheck/SpecialLandingCheck.php
___________________________________________________________________
Added: svn:mergeinfo
189188 Merged /branches/sqlite/extensions/LandingCheck/SpecialLandingCheck.php:r58211-58321
190189 Merged /trunk/phase3/extensions/LandingCheck/SpecialLandingCheck.php:r111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
191190 Merged /branches/new-installer/phase3/extensions/LandingCheck/SpecialLandingCheck.php:r43664-66004
192191 Merged /branches/JSTesting/extensions/LandingCheck/SpecialLandingCheck.php:r100352-107913
193192 Merged /branches/REL1_15/phase3/extensions/LandingCheck/SpecialLandingCheck.php:r51646
194193 Merged /branches/wmf/1.18wmf1/extensions/LandingCheck/SpecialLandingCheck.php:r97508
195194 Merged /branches/REL1_17/phase3/extensions/LandingCheck/SpecialLandingCheck.php:r81445,81448
196195 Merged /trunk/extensions/LandingCheck/SpecialLandingCheck.php:r111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112153,112160,112166,112260,112282,112300

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112300Fixes for r94907/r94908: change in fallback behaviour allowing infinite loops...tstarling05:14, 24 February 2012

Status & tagging log