Title::newMainPage(): don't give a fatal error if the message is broken
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 13 Feb 2008 06:13:03 +0000 (06:13 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 13 Feb 2008 06:13:03 +0000 (06:13 +0000)
includes/Title.php

index 4c08f85..8a9d3ee 100644 (file)
@@ -268,7 +268,12 @@ class Title {
         * @return Title the new object
         */
        public static function newMainPage() {
-               return Title::newFromText( wfMsgForContent( 'mainpage' ) );
+               $title = Title::newFromText( wfMsgForContent( 'mainpage' ) );
+               // Don't give fatal errors if the message is broken
+               if ( !$title ) {
+                       $title = Title::newFromText( 'Main Page' );
+               }
+               return $title;
        }
 
        /**