(bug 37330) Fix wrong block being displayed due to autoblock in place.
authorVictor Vasiliev <vasilvv@gmail.com>
Mon, 4 Jun 2012 23:30:33 +0000 (01:30 +0200)
committerVictor Vasiliev <vasilvv@gmail.com>
Mon, 4 Jun 2012 23:30:33 +0000 (01:30 +0200)
Autoblocks triggered latest block log entry being displayed, which was
naturally the wrong one, since autoblocks are not put into a block log.

Change-Id: Ic08880c18a778d5294bb934c764a70dbd7800b70

includes/specials/SpecialContributions.php

index 1b7494f..62b34ad 100644 (file)
@@ -235,7 +235,9 @@ class SpecialContributions extends SpecialPage {
                        $links = $this->getLanguage()->pipeList( $tools );
 
                        // Show a note if the user is blocked and display the last block log entry.
-                       if ( $userObj->isBlocked() ) {
+                       // Do not expose the autoblocks, since that may lead to a leak of accounts' IPs,
+                       // and also this will display a totally irrelevant log entry as a current block.
+                       if ( $userObj->isBlocked() && $userObj->getBlock()->getType() != Block::TYPE_AUTO ) {
                                $out = $this->getOutput(); // showLogExtract() wants first parameter by reference
                                LogEventsList::showLogExtract(
                                        $out,