r96909 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96908‎ | r96909 | r96910 >
Date:21:26, 12 September 2011
Author:robin
Status:ok
Tags:
Comment:
* Some documentation
* Use Title->isMainPage() in Article->view()
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -561,7 +561,7 @@
562562 # tents of 'pagetitle-view-mainpage' instead of the default (if
563563 # that's not empty).
564564 # This message always exists because it is in the i18n files
565 - if ( $this->getTitle()->equals( Title::newMainPage() ) ) {
 565+ if ( $this->getTitle()->isMainPage() ) {
566566 $msg = wfMessage( 'pagetitle-view-mainpage' )->inContentLanguage();
567567 if ( !$msg->isDisabled() ) {
568568 $wgOut->setHTMLTitle( $msg->title( $this->getTitle() )->text() );
Index: trunk/phase3/includes/Title.php
@@ -1898,6 +1898,7 @@
18991899 * acidentally creating new bugs where $title->equals( Title::newFromText() )
19001900 * ends up reporting something differently than $title->isMainPage();
19011901 *
 1902+ * @since 1.18
19021903 * @return Bool
19031904 */
19041905 public function isMainPage() {
Index: trunk/phase3/languages/Language.php
@@ -218,6 +218,10 @@
219219 return preg_match( '/^[a-z0-9-]+$/i', $code );
220220 }
221221
 222+ /**
 223+ * @param $code
 224+ * @return String Name of the language class
 225+ */
222226 public static function classFromCode( $code ) {
223227 if ( $code == 'en' ) {
224228 return 'Language';
@@ -226,6 +230,11 @@
227231 }
228232 }
229233
 234+ /**
 235+ * Includes language class files
 236+ *
 237+ * @param $class Name of the language class
 238+ */
230239 public static function preloadLanguageClass( $class ) {
231240 global $IP;
232241

Status & tagging log