* Use Title->isMainPage() in Article->view()
# 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() );
* 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() {
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';
}
}
+ /**
+ * Includes language class files
+ *
+ * @param $class Name of the language class
+ */
public static function preloadLanguageClass( $class ) {
global $IP;