Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -303,7 +303,7 @@ |
304 | 304 | * to internalParse() which does all the real work. |
305 | 305 | */ |
306 | 306 | |
307 | | - global $wgUseTidy, $wgAlwaysUseTidy, $wgContLang, $wgDisableLangConversion; |
| 307 | + global $wgUseTidy, $wgAlwaysUseTidy, $wgContLang, $wgDisableLangConversion, $wgUser, $wgRequest, $wgDisableTitleConversion; |
308 | 308 | $fname = __METHOD__.'-' . wfGetCaller(); |
309 | 309 | wfProfileIn( __METHOD__ ); |
310 | 310 | wfProfileIn( $fname ); |
— | — | @@ -347,13 +347,11 @@ |
348 | 348 | /** |
349 | 349 | * The page doesn't get language converted if |
350 | 350 | * a) It's disabled |
351 | | - * b) Titles aren't converted |
352 | | - * c) Content isn't converted and this is not a talk page |
353 | | - * d) It's a conversion table |
| 351 | + * c) Content isn't converted |
| 352 | + * d) It's a conversion table |
354 | 353 | */ |
355 | 354 | if ( !( $wgDisableLangConversion |
356 | | - || isset( $this->mDoubleUnderscores['notitleconvert'] ) |
357 | | - || ( isset( $this->mDoubleUnderscores['nocontentconvert'] ) && !$this->mTitle->isTalkPage() ) |
| 355 | + || isset( $this->mDoubleUnderscores['nocontentconvert'] ) |
358 | 356 | || $this->mTitle->isConversionTable() ) ) { |
359 | 357 | |
360 | 358 | # The position of the convert() call should not be changed. it |
— | — | @@ -363,12 +361,34 @@ |
364 | 362 | $text = $wgContLang->convert( $text ); |
365 | 363 | } |
366 | 364 | |
367 | | - # A title may have been set in a conversion rule. |
368 | | - # Note that if a user tries to set a title in a conversion |
369 | | - # rule but content conversion was not done, then the parser |
370 | | - # won't pick it up. This is probably expected behavior. |
371 | | - if ( $wgContLang->getConvRuleTitle() ) { |
372 | | - $this->mOutput->setTitleText( $wgContLang->getConvRuleTitle() ); |
| 365 | + /** |
| 366 | + * A page get its title converted except: |
| 367 | + * a) Content convert is globally disabled |
| 368 | + * b) Title convert is globally disabled |
| 369 | + * c) The page is a redirect page |
| 370 | + * d) User request with a "linkconvert" set to "no" |
| 371 | + * e) A "nocontentconvert" magic word has been set |
| 372 | + * f) A "notitleconvert" magic word has been set |
| 373 | + * g) User sets "noconvertlink" in his/her preference |
| 374 | + * |
| 375 | + * Note that if a user tries to set a title in a conversion |
| 376 | + * rule but content conversion was not done, then the parser |
| 377 | + * won't pick it up. This is probably expected behavior. |
| 378 | + */ |
| 379 | + if ( !( $wgDisableContentConversion |
| 380 | + || $wgDisableTitleConversion |
| 381 | + || $wgRequest->getText( 'redirect', 'yes' ) == 'no' |
| 382 | + || $wgRequest->getText( 'linkconvert', 'yes' ) == 'no' |
| 383 | + || isset( $this->mDoubleUnderscores['nocontentconvert'] ) |
| 384 | + || isset( $this->mDoubleUnderscores['notitleconvert'] ) |
| 385 | + || $wgUser->getOption( 'noconvertlink' ) == 1 ) ) { |
| 386 | + $convruletitle = $wgContLang->getConvRuleTitle(); |
| 387 | + if ( $convruletitle ) { |
| 388 | + $this->mOutput->setTitleText( $convruletitle ); |
| 389 | + } |
| 390 | + else { |
| 391 | + $this->mOutput->setTitleText( $wgContLang->convert( $title->getText() ) ); |
| 392 | + } |
373 | 393 | } |
374 | 394 | |
375 | 395 | $text = $this->mStripState->unstripNoWiki( $text ); |