r75766 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75765‎ | r75766 | r75767 >
Date:00:03, 1 November 2010
Author:reedy
Status:ok
Tags:
Comment:
Fixup undefined $this->id

Fix assignment in conditional
Modified paths:
  • /trunk/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialIpblocklist.php
@@ -71,10 +71,10 @@
7272
7373 # bug 15810: blocked admins should have limited access here
7474 if ( $wgUser->isBlocked() ) {
75 - if ( $id ) {
 75+ if ( $this->id ) {
7676 # This doesn't pick up on autoblocks, but admins
7777 # should have the ipblock-exempt permission anyway
78 - $block = Block::newFromID( $id );
 78+ $block = Block::newFromID( $this->id );
7979 $user = User::newFromName( $block->mAddress );
8080 } else {
8181 $user = User::newFromName( $ip );
@@ -284,7 +284,8 @@
285285 $conds['ipb_id'] = substr( $this->ip, 1 );
286286 // Single IPs
287287 } elseif ( IP::isIPAddress( $this->ip ) && strpos( $this->ip, '/' ) === false ) {
288 - if( $iaddr = IP::toHex( $this->ip ) ) {
 288+ $iaddr = IP::toHex( $this->ip );
 289+ if( $iaddr ) {
289290 # Only scan ranges which start in this /16, this improves search speed
290291 # Blocks should not cross a /16 boundary.
291292 $range = substr( $iaddr, 0, 4 );

Status & tagging log