From 6f6d09b0e4d8a562638f30ce7a1a528b8c612050 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 24 Sep 2008 08:46:18 +0000 Subject: [PATCH] Fix docs for r41150, remove commented-out code, remove superfluous brackets in "new" expressions. --- includes/Block.php | 12 +++++++----- includes/User.php | 7 +++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index 092b8e89b8..0fe9365b09 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -60,7 +60,7 @@ class Block { * @param $killExpired bool Delete expired blocks on load */ static function newFromDB( $address, $user = 0, $killExpired = true ) { - $block = new Block(); + $block = new Block; $block->load( $address, $user, $killExpired ); if ( $block->isValid() ) { return $block; @@ -79,7 +79,7 @@ class Block { $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*', array( 'ipb_id' => $id ), __METHOD__ ) ); - $block = new Block(); + $block = new Block; if ( $block->loadFromResult( $res ) ) { return $block; } else { @@ -162,8 +162,9 @@ class Block { if ( $user && $this->mAnonOnly ) { # Block is marked anon-only # Whitelist this IP address against autoblocks and range blocks + # (but not account creation blocks -- bug 13611) if( !$this->mCreateAccount ) { - $this->clear(); // bug 13611 - keep this data + $this->clear(); } return false; } else { @@ -175,8 +176,9 @@ class Block { # Try range block if ( $this->loadRange( $address, $killExpired, $user ) ) { if ( $user && $this->mAnonOnly ) { + # Respect account creation blocks on logged-in users -- bug 13611 if( !$this->mCreateAccount ) { - $this->clear(); // bug 13611 - keep this data + $this->clear(); } return false; } else { @@ -336,7 +338,7 @@ class Block { /*static*/ function enumBlocks( $callback, $tag, $flags = 0 ) { global $wgAntiLockFlags; - $block = new Block(); + $block = new Block; if ( $flags & Block::EB_FOR_UPDATE ) { $db = wfGetDB( DB_MASTER ); if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) { diff --git a/includes/User.php b/includes/User.php index d0f41b53d9..d8d6e36db2 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1053,10 +1053,9 @@ class User { $this->spreadBlock(); } } else { - // Bug 13611, apply account creation blocks to users. - // Note that the existence of $this->mBlock is not used - // to check for edit blocks, $this->mBlockedby is instead. - # $this->mBlock = null; + // Bug 13611: don't remove mBlock here, to allow account creation blocks to + // apply to users. Note that the existence of $this->mBlock is not used to + // check for edit blocks, $this->mBlockedby is instead. } # Proxy blocking -- 2.20.1