Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php |
— | — | @@ -574,12 +574,15 @@ |
575 | 575 | |
576 | 576 | /** |
577 | 577 | * make "Wx/xxx/Main Page" |
578 | | - * @return String |
| 578 | + * @param $langCode String: The language code |
| 579 | + * @param $prefix Null|String: the "Wx/xxx" prefix to add |
| 580 | + * @return Title |
579 | 581 | */ |
580 | 582 | public static function getMainPage( $langCode, $prefix = null ) { |
581 | 583 | # Take the "mainpage" msg in the given language |
582 | 584 | $msg = wfMsgExt( 'mainpage', array( 'language' => $langCode ) ); |
583 | | - return $prefix !== null ? $prefix . '/' . $msg : $msg; |
| 585 | + $mainpage = $prefix !== null ? $prefix . '/' . $msg : $msg; |
| 586 | + return Title::newFromText( $mainpage ); |
584 | 587 | } |
585 | 588 | |
586 | 589 | /** |
— | — | @@ -607,9 +610,7 @@ |
608 | 611 | # pass through the &uselang parameter |
609 | 612 | $params['uselang'] = $uselang; |
610 | 613 | } |
611 | | - $mainpage = Title::newFromText( |
612 | | - self::getMainPage( $prefix['lang'], $prefix['prefix'] ) |
613 | | - ); |
| 614 | + $mainpage = self::getMainPage( $prefix['lang'], $prefix['prefix'] ); |
614 | 615 | if( $mainpage->exists() ) { |
615 | 616 | # Only redirect to the main page if that page exists |
616 | 617 | $wgOut->redirect( $mainpage->getFullURL( $params ) ); |
Index: trunk/extensions/WikimediaIncubator/InfoPage.php |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | $portalLink = Linker::makeExternalLink( $this->mPortal, $this->mProjectName ); |
168 | 168 | if( $this->mThisLangData['type'] != 'invalid' ) { |
169 | 169 | $gotoLink = Linker::link( |
170 | | - Title::newFromText( IncubatorTest::getMainPage( $this->mLangCode, $this->mPrefix ) ), |
| 170 | + IncubatorTest::getMainPage( $this->mLangCode, $this->mPrefix ), |
171 | 171 | wfMsgNoTrans( 'wminc-infopage-enter' ) ); |
172 | 172 | $gotoMainPage = Html::rawElement( 'span', |
173 | 173 | array( 'class' => 'wminc-infopage-entertest' ), |