r89563 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89562‎ | r89563 | r89564 >
Date:14:23, 6 June 2011
Author:robin
Status:ok
Tags:
Comment:
Two fixes for older MediaWiki versions
* SpecialViewUserLang: $this->getSkin to $wgUser->getSkin (fixed by Roan in r89557)
* selecting a different namespace for random pages
Modified paths:
  • /trunk/extensions/WikimediaIncubator/SpecialRandomByTest.php (modified) (history)
  • /trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/SpecialRandomByTest.php
@@ -13,8 +13,12 @@
1414 $this->extra[] = 'page_title' .
1515 $dbr->buildLike( IncubatorTest::displayPrefix() . '/', $dbr->anyString() );
1616 } elseif($wgUser->getOption($wmincPref . '-project') == $wmincProjectSite['short'] ) {
17 - // project or help namespace
18 - $this->extra['page_namespace'] = array( 4, 12 );
 17+ global $wgVersion;
 18+ // only works above MW 1.17
 19+ if( version_compare($wgVersion, '1.17', '>') ) {
 20+ // project or help namespace
 21+ $this->extra['page_namespace'] = array( 4, 12 );
 22+ }
1923 }
2024 parent::__construct( 'RandomByTest' );
2125 }
Index: trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php
@@ -67,8 +67,8 @@
6868 * @param $target Mixed: user whose language and test wiki we're looking up
6969 */
7070 function showInfo( $target ) {
71 - global $wgOut, $wmincPref, $wmincProjectSite;
72 - $sk = $this->getSkin();
 71+ global $wgOut, $wmincPref, $wmincProjectSite, $wgUser;
 72+ $sk = $wgUser->getSkin();
7373 $user = User::newFromName( $target );
7474 $langNames = Language::getLanguageNames();
7575 if ( $user == null || $user->getId() == 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r895651.17wmf1: MFT r89563catrope14:53, 6 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r895571.17wmf1: Live hack WikimediaIncubator to work around the fact that SpecialPa...catrope11:54, 6 June 2011

Status & tagging log