From: <ro...@us...> - 2012-04-09 20:23:28
|
Revision: 78 http://wm-incubator.svn.sourceforge.net/wm-incubator/?rev=78&view=rev Author: robin-p Date: 2012-04-09 20:23:21 +0000 (Mon, 09 Apr 2012) Log Message: ----------- sync with stable wikimedia git Modified Paths: -------------- trunk/IncubatorTest.php trunk/WikimediaIncubator.php Modified: trunk/IncubatorTest.php =================================================================== --- trunk/IncubatorTest.php 2012-03-24 16:20:23 UTC (rev 77) +++ trunk/IncubatorTest.php 2012-04-09 20:23:21 UTC (rev 78) @@ -607,24 +607,23 @@ * Redirect if &goto=mainpage on info pages * @return True */ - public static function onArticleFromTitle( &$title, &$article ) { - global $wgRequest; + public static function onMediaWikiPerformAction( $output, $page, $title, $user, $request ) { $prefix = IncubatorTest::analyzePrefix( $title, true ); - if( $prefix['error'] || $wgRequest->getVal('goto') != 'mainpage' ) { + if( $prefix['error'] || $request->getVal( 'goto' ) != 'mainpage' ) { return true; } + $dbstate = self::getDBState( $prefix ); if( !$dbstate ) { return true; } - global $wgOut; if( $dbstate == 'existing' ) { # redirect to the existing lang.wikiproject.org if it exists - $wgOut->redirect( self::getSubdomain( $prefix['lang'], $prefix['project'] ) ); - return true; + $output->redirect( self::getSubdomain( $prefix['lang'], $prefix['project'] ) ); + return false; } $params['redirectfrom'] = 'infopage'; - $uselang = $wgRequest->getVal( 'uselang' ); + $uselang = $request->getVal( 'uselang' ); if( $uselang ) { # pass through the &uselang parameter $params['uselang'] = $uselang; @@ -632,7 +631,8 @@ $mainpage = self::getMainPage( $prefix['lang'], $prefix['prefix'] ); if( $mainpage->exists() ) { # Only redirect to the main page if that page exists - $wgOut->redirect( $mainpage->getFullURL( $params ) ); + $output->redirect( $mainpage->getFullURL( $params ) ); + return false; } return true; } Modified: trunk/WikimediaIncubator.php =================================================================== --- trunk/WikimediaIncubator.php 2012-03-24 16:20:23 UTC (rev 77) +++ trunk/WikimediaIncubator.php 2012-04-09 20:23:21 UTC (rev 78) @@ -127,7 +127,7 @@ $wgExtensionMessagesFiles['InfoPage'] = $dir . 'InfoPage.i18n.php'; $wgHooks['ShowMissingArticle'][] = 'IncubatorTest::onShowMissingArticle'; $wgHooks['EditFormPreloadText'][] = 'IncubatorTest::onEditFormPreloadText'; -$wgHooks['ArticleFromTitle'][] = 'IncubatorTest::onArticleFromTitle'; +$wgHooks['MediaWikiPerformAction'][] = 'IncubatorTest::onMediaWikiPerformAction'; $wgHooks['TitleIsAlwaysKnown'][] = 'IncubatorTest::onTitleIsAlwaysKnown'; $wgResourceModules['WikimediaIncubator.InfoPage'] = array( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |