r82339 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82338‎ | r82339 | r82340 >
Date:17:06, 17 February 2011
Author:ialex
Status:ok
Tags:
Comment:
* Don't use assignment in a condition check
* Pass the Title object so that it doesn't rely on $wgTitle
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1033,10 +1033,11 @@
10341034 # tents of 'pagetitle-view-mainpage' instead of the default (if
10351035 # that's not empty).
10361036 # This message always exists because it is in the i18n files
1037 - if ( $this->mTitle->equals( Title::newMainPage() )
1038 - && ( $m = wfMsgForContent( 'pagetitle-view-mainpage' ) ) !== '' )
1039 - {
1040 - $wgOut->setHTMLTitle( $m );
 1037+ if ( $this->mTitle->equals( Title::newMainPage() ) ) {
 1038+ $msg = wfMessage( 'pagetitle-view-mainpage' )->inContentLanguage();
 1039+ if ( !$msg->isDisabled() ) {
 1040+ $wgOut->setHTMLTitle( $msg->title( $this->mTitle )->text() );
 1041+ }
10411042 }
10421043
10431044 # Now that we've filled $this->mParserOutput, we know whether

Status & tagging log