r41221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41220‎ | r41221 | r41222 >
Date:08:46, 24 September 2008
Author:tstarling
Status:old
Tags:
Comment:
Fix docs for r41150, remove commented-out code, remove superfluous brackets in "new" expressions.
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1053,10 +1053,9 @@
10541054 $this->spreadBlock();
10551055 }
10561056 } else {
1057 - // Bug 13611, apply account creation blocks to users.
1058 - // Note that the existence of $this->mBlock is not used
1059 - // to check for edit blocks, $this->mBlockedby is instead.
1060 - # $this->mBlock = null;
 1057+ // Bug 13611: don't remove mBlock here, to allow account creation blocks to
 1058+ // apply to users. Note that the existence of $this->mBlock is not used to
 1059+ // check for edit blocks, $this->mBlockedby is instead.
10611060 }
10621061
10631062 # Proxy blocking
Index: trunk/phase3/includes/Block.php
@@ -60,7 +60,7 @@
6161 * @param $killExpired bool Delete expired blocks on load
6262 */
6363 static function newFromDB( $address, $user = 0, $killExpired = true ) {
64 - $block = new Block();
 64+ $block = new Block;
6565 $block->load( $address, $user, $killExpired );
6666 if ( $block->isValid() ) {
6767 return $block;
@@ -79,7 +79,7 @@
8080 $dbr = wfGetDB( DB_SLAVE );
8181 $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*',
8282 array( 'ipb_id' => $id ), __METHOD__ ) );
83 - $block = new Block();
 83+ $block = new Block;
8484 if ( $block->loadFromResult( $res ) ) {
8585 return $block;
8686 } else {
@@ -162,8 +162,9 @@
163163 if ( $user && $this->mAnonOnly ) {
164164 # Block is marked anon-only
165165 # Whitelist this IP address against autoblocks and range blocks
 166+ # (but not account creation blocks -- bug 13611)
166167 if( !$this->mCreateAccount ) {
167 - $this->clear(); // bug 13611 - keep this data
 168+ $this->clear();
168169 }
169170 return false;
170171 } else {
@@ -175,8 +176,9 @@
176177 # Try range block
177178 if ( $this->loadRange( $address, $killExpired, $user ) ) {
178179 if ( $user && $this->mAnonOnly ) {
 180+ # Respect account creation blocks on logged-in users -- bug 13611
179181 if( !$this->mCreateAccount ) {
180 - $this->clear(); // bug 13611 - keep this data
 182+ $this->clear();
181183 }
182184 return false;
183185 } else {
@@ -336,7 +338,7 @@
337339 /*static*/ function enumBlocks( $callback, $tag, $flags = 0 ) {
338340 global $wgAntiLockFlags;
339341
340 - $block = new Block();
 342+ $block = new Block;
341343 if ( $flags & Block::EB_FOR_UPDATE ) {
342344 $db = wfGetDB( DB_MASTER );
343345 if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41150Apply account creation blocks to users (bug 13611)aaron13:21, 22 September 2008