r64820 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64819‎ | r64820 | r64821 >
Date:19:16, 9 April 2010
Author:philip
Status:deferred
Tags:
Comment:
Bug 23115: Follow up on r64819. Apply on REL1_16.
Modified paths:
  • /branches/REL1_16/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: branches/REL1_16/phase3/includes/parser/Parser.php
@@ -305,7 +305,7 @@
306306 * to internalParse() which does all the real work.
307307 */
308308
309 - global $wgUseTidy, $wgAlwaysUseTidy, $wgContLang, $wgDisableLangConversion;
 309+ global $wgUseTidy, $wgAlwaysUseTidy, $wgContLang, $wgDisableLangConversion, $wgUser, $wgRequest, $wgDisableTitleConversion;
310310 $fname = __METHOD__.'-' . wfGetCaller();
311311 wfProfileIn( __METHOD__ );
312312 wfProfileIn( $fname );
@@ -349,13 +349,11 @@
350350 /**
351351 * The page doesn't get language converted if
352352 * 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
356355 */
357356 if ( !( $wgDisableLangConversion
358 - || isset( $this->mDoubleUnderscores['notitleconvert'] )
359 - || ( isset( $this->mDoubleUnderscores['nocontentconvert'] ) && !$this->mTitle->isTalkPage() )
 357+ || isset( $this->mDoubleUnderscores['nocontentconvert'] )
360358 || $this->mTitle->isConversionTable() ) ) {
361359
362360 # The position of the convert() call should not be changed. it
@@ -365,12 +363,34 @@
366364 $text = $wgContLang->convert( $text );
367365 }
368366
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+ }
375395 }
376396
377397 $text = $this->mStripState->unstripNoWiki( $text );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64819Bug 23115: Follow up on r64811. Fix another bug which cause talk page can't c...philip19:02, 9 April 2010

Status & tagging log