* Some documentation
authorRobin Pepermans <robin@users.mediawiki.org>
Mon, 12 Sep 2011 21:26:08 +0000 (21:26 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Mon, 12 Sep 2011 21:26:08 +0000 (21:26 +0000)
* Use Title->isMainPage() in Article->view()

includes/Article.php
includes/Title.php
languages/Language.php

index 24cadc0..120e21d 100644 (file)
@@ -561,7 +561,7 @@ class Article extends Page {
                # 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->getTitle()->equals( Title::newMainPage() ) ) {
+               if ( $this->getTitle()->isMainPage() ) {
                        $msg = wfMessage( 'pagetitle-view-mainpage' )->inContentLanguage();
                        if ( !$msg->isDisabled() ) {
                                $wgOut->setHTMLTitle( $msg->title( $this->getTitle() )->text() );
index 557d97f..5ec985c 100644 (file)
@@ -1898,6 +1898,7 @@ class Title {
         * acidentally creating new bugs where $title->equals( Title::newFromText() )
         * ends up reporting something differently than $title->isMainPage();
         *
+        * @since 1.18
         * @return Bool
         */
        public function isMainPage() {
index f728014..15f3329 100644 (file)
@@ -218,6 +218,10 @@ class Language {
                return preg_match( '/^[a-z0-9-]+$/i', $code );
        }
 
+       /**
+        * @param $code
+        * @return String Name of the language class
+        */
        public static function classFromCode( $code ) {
                if ( $code == 'en' ) {
                        return 'Language';
@@ -226,6 +230,11 @@ class Language {
                }
        }
 
+       /**
+        * Includes language class files
+        * 
+        * @param $class Name of the language class
+        */
        public static function preloadLanguageClass( $class ) {
                global $IP;