From: Tobias Date: Mon, 7 Sep 2009 12:04:07 +0000 (+0000) Subject: fixing r55909: checking if the user is _currently_ blocked before displaying block... X-Git-Tag: 1.31.0-rc.0~39884 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=92ab15aca835ee46ebdfa20f320d9576f93f1427;p=lhc%2Fweb%2Fwiklou.git fixing r55909: checking if the user is _currently_ blocked before displaying block log (on Special:Contributions) --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index c78c337a8f..e365ba820a 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -223,7 +223,7 @@ class SpecialContributions extends SpecialPage { wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) ); $links = $wgLang->pipeList( $tools ); - $this->showBlock( $nt ); + $this->showBlock( $nt, $id ); } // Old message 'contribsub' had one parameter, but that doesn't work for @@ -241,8 +241,10 @@ class SpecialContributions extends SpecialPage { * Show a note if the user is blocked and display the last block log entry. * @param Title $nt Title object for the target */ - protected function showBlock( $nt ) { + protected function showBlock( $nt, $id ) { global $wgUser, $wgOut; + if ( !User::newFromID( $id )->isBlocked() ) + return; # User is not blocked, nothing to do here $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut ); $pager = new LogPager( $loglist, 'block', false, $nt->getPrefixedText() ); // Check if there is something in the block log.