From 87469c3e1df3195da78c86af35eb2b44178ad819 Mon Sep 17 00:00:00 2001 From: Tobias Date: Wed, 23 Sep 2009 22:48:55 +0000 Subject: [PATCH] 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) --- includes/specials/SpecialContributions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index e5a5d720c1..0290134800 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -157,13 +157,14 @@ class SpecialContributions extends SpecialPage { } else { $user = $sk->link( $nt, htmlspecialchars( $nt->getText() ) ); } + $userObj = User::newFromName( $nt->getText(), /* check for username validity not needed */ false ); $talk = $nt->getTalkPage(); if( $talk ) { # Talk page link $tools[] = $sk->link( $talk, wfMsgHtml( 'sp-contributions-talk' ) ); if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) { if( $wgUser->isAllowed( 'block' ) ) { # Block / Change block / Unblock links - if ( User::newFromId( $id )->isBlocked() ) { + if ( $userObj->isBlocked() ) { $tools[] = $sk->linkKnown( # Change block link SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'change-blocklink' ) @@ -226,7 +227,7 @@ class SpecialContributions extends SpecialPage { $links = $wgLang->pipeList( $tools ); // Show a note if the user is blocked and display the last block log entry. - if ( User::newFromID( $id )->isBlocked() ) { + if ( $userObj->isBlocked() ) { LogEventsList::showLogExtract( $wgOut, 'block', -- 2.20.1