fixing r55909: checking if the user is _currently_ blocked before displaying block...
authorTobias <churchofemacs@users.mediawiki.org>
Mon, 7 Sep 2009 12:04:07 +0000 (12:04 +0000)
committerTobias <churchofemacs@users.mediawiki.org>
Mon, 7 Sep 2009 12:04:07 +0000 (12:04 +0000)
includes/specials/SpecialContributions.php

index c78c337..e365ba8 100644 (file)
@@ -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.