From: Tobias Date: Wed, 23 Sep 2009 22:48:55 +0000 (+0000) Subject: Follow-up on r55909 and r55903: Note / block log excerpt and block/unblock links... X-Git-Tag: 1.31.0-rc.0~39551 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=87469c3e1df3195da78c86af35eb2b44178ad819;p=lhc%2Fweb%2Fwiklou.git 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) --- 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',