Index: trunk/extensions/LandingCheck/SpecialLandingCheck.php |
— | — | @@ -35,11 +35,13 @@ |
36 | 36 | // Build array of landing pages to check for |
37 | 37 | $targetTexts = array( |
38 | 38 | $landingPage . '/' . $language . '/' . $country, |
39 | | - $landingPage . '/' . $language, |
40 | | - $landingPage . '/' . Language::getFallbackFor( $language ) |
| 39 | + $landingPage . '/' . $language |
41 | 40 | ); |
42 | | - if ( $language != 'en' ) { |
43 | | - $targetTexts[] = $landingPage . '/en'; // English fallback |
| 41 | + // Add fallback languages |
| 42 | + $code = $language; |
| 43 | + while ( $code !== 'en' ) { |
| 44 | + $code = Language::getFallbackFor( $code ); |
| 45 | + $targetTexts[] = $landingPage . '/' . $code; |
44 | 46 | } |
45 | 47 | |
46 | 48 | // Go through the possible landing pages and redirect the user as soon as one is found to exist |