* Don't use assignment in a condition check
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 17 Feb 2011 17:06:06 +0000 (17:06 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Thu, 17 Feb 2011 17:06:06 +0000 (17:06 +0000)
* Pass the Title object so that it doesn't rely on $wgTitle

includes/Article.php

index 82bef47..40a2c4f 100644 (file)
@@ -1033,10 +1033,11 @@ class Article {
                # tents of 'pagetitle-view-mainpage' instead of the default (if
                # that's not empty).
                # This message always exists because it is in the i18n files
-               if ( $this->mTitle->equals( Title::newMainPage() )
-                       && ( $m = wfMsgForContent( 'pagetitle-view-mainpage' ) ) !== '' )
-               {
-                       $wgOut->setHTMLTitle( $m );
+               if ( $this->mTitle->equals( Title::newMainPage() ) ) {
+                       $msg = wfMessage( 'pagetitle-view-mainpage' )->inContentLanguage();
+                       if ( !$msg->isDisabled() ) {
+                               $wgOut->setHTMLTitle( $msg->title( $this->mTitle )->text() );
+                       }
                }
 
                # Now that we've filled $this->mParserOutput, we know whether