r64922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64921‎ | r64922 | r64923 >
Date:05:19, 11 April 2010
Author:overlordq
Status:ok
Tags:
Comment:
Fix so that toolbox entries correctly show on user subpages
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinTemplate.php
@@ -930,8 +930,10 @@
931931 }
932932
933933 if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
934 - $id = User::idFromName( $this->mTitle->getText() );
935 - $ip = User::isIP( $this->mTitle->getText() );
 934+ $parts = explode( '/', $this->mTitle->getText() );
 935+ $rootUser = $parts[0];
 936+ $id = User::idFromName( $rootUser );
 937+ $ip = User::isIP( $rootUser );
936938 } else {
937939 $id = 0;
938940 $ip = false;
@@ -939,7 +941,7 @@
940942
941943 if( $id || $ip ) { # both anons and non-anons have contribs list
942944 $nav_urls['contributions'] = array(
943 - 'href' => self::makeSpecialUrlSubpage( 'Contributions', $this->mTitle->getText() )
 945+ 'href' => self::makeSpecialUrlSubpage( 'Contributions', $rootUser )
944946 );
945947
946948 if( $id ) {
@@ -947,7 +949,7 @@
948950 $nav_urls['log'] = array(
949951 'href' => $logPage->getLocalUrl(
950952 array(
951 - 'user' => $this->mTitle->getText()
 953+ 'user' => $rootUser
952954 )
953955 )
954956 );
@@ -957,7 +959,7 @@
958960
959961 if ( $wgUser->isAllowed( 'block' ) ) {
960962 $nav_urls['blockip'] = array(
961 - 'href' => self::makeSpecialUrlSubpage( 'Blockip', $this->mTitle->getText() )
 963+ 'href' => self::makeSpecialUrlSubpage( 'Blockip', $rootUser )
962964 );
963965 } else {
964966 $nav_urls['blockip'] = false;
@@ -970,7 +972,7 @@
971973 $nav_urls['emailuser'] = false;
972974 if( $this->showEmailUser( $id ) ) {
973975 $nav_urls['emailuser'] = array(
974 - 'href' => self::makeSpecialUrlSubpage( 'Emailuser', $this->mTitle->getText() )
 976+ 'href' => self::makeSpecialUrlSubpage( 'Emailuser', $rootUser )
975977 );
976978 }
977979 wfProfileOut( __METHOD__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r77760Style cleanup to r64922demon04:13, 5 December 2010

Status & tagging log