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