Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php |
— | — | @@ -176,16 +176,21 @@ |
177 | 177 | * |
178 | 178 | * @param string $pageName |
179 | 179 | * @param boolean $parse |
| 180 | + * @param string $langCode |
180 | 181 | * |
181 | 182 | * @return string|false |
182 | 183 | */ |
183 | | - protected function getPageContent( $pageName, $parse = false ) { |
| 184 | + protected function getPageContent( $pageName, $parse = false, $langCode = null ) { |
184 | 185 | $content = false; |
185 | 186 | |
186 | 187 | if ( trim( $pageName ) != '' ) { |
187 | | - global $wgLang; |
188 | | - $page = Title::newFromText( str_replace( '$1', $wgLang->getCode(), $pageName ) ); |
| 188 | + if ( is_null( $langCode ) ) { |
| 189 | + global $wgLang; |
| 190 | + $langCode = $wgLang->getCode(); |
| 191 | + } |
189 | 192 | |
| 193 | + $page = Title::newFromText( str_replace( '$1', $langCode, $pageName ) ); |
| 194 | + |
190 | 195 | if ( !is_null( $page ) && $page->exists() ) { |
191 | 196 | $article = new Article( $page, 0 ); |
192 | 197 | $content = $article->getContent(); |
— | — | @@ -196,6 +201,11 @@ |
197 | 202 | } |
198 | 203 | } |
199 | 204 | |
| 205 | + // If no page was found, and the lang is not en, then see if there in an en version. |
| 206 | + if ( $content === false && $langCode != 'en' ) { |
| 207 | + $content = $this->getPageContent( $pageName, $parse, 'en' ); |
| 208 | + } |
| 209 | + |
200 | 210 | return $content; |
201 | 211 | } |
202 | 212 | |