r56859 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56858‎ | r56859 | r56860 >
Date:22:48, 23 September 2009
Author:churchofemacs
Status:ok
Tags:
Comment:
Follow-up on r55909 and r55903: Note / block log excerpt and block/unblock links on Special:Contributions should now also work for IPs (did not work with User::newFromId)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -157,13 +157,14 @@
158158 } else {
159159 $user = $sk->link( $nt, htmlspecialchars( $nt->getText() ) );
160160 }
 161+ $userObj = User::newFromName( $nt->getText(), /* check for username validity not needed */ false );
161162 $talk = $nt->getTalkPage();
162163 if( $talk ) {
163164 # Talk page link
164165 $tools[] = $sk->link( $talk, wfMsgHtml( 'sp-contributions-talk' ) );
165166 if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) {
166167 if( $wgUser->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
167 - if ( User::newFromId( $id )->isBlocked() ) {
 168+ if ( $userObj->isBlocked() ) {
168169 $tools[] = $sk->linkKnown( # Change block link
169170 SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
170171 wfMsgHtml( 'change-blocklink' )
@@ -226,7 +227,7 @@
227228 $links = $wgLang->pipeList( $tools );
228229
229230 // Show a note if the user is blocked and display the last block log entry.
230 - if ( User::newFromID( $id )->isBlocked() ) {
 231+ if ( $userObj->isBlocked() ) {
231232 LogEventsList::showLogExtract(
232233 $wgOut,
233234 'block',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55903Show change block / unblock link on Special:Contributions if user is blockedchurchofemacs22:53, 6 September 2009
r55909Display note on Special:Contributions if user is blocked, and provide an exce...churchofemacs01:29, 7 September 2009

Status & tagging log