Index: trunk/phase3/includes/User.php |
— | — | @@ -1053,10 +1053,9 @@ |
1054 | 1054 | $this->spreadBlock(); |
1055 | 1055 | } |
1056 | 1056 | } 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. |
1061 | 1060 | } |
1062 | 1061 | |
1063 | 1062 | # Proxy blocking |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | * @param $killExpired bool Delete expired blocks on load |
62 | 62 | */ |
63 | 63 | static function newFromDB( $address, $user = 0, $killExpired = true ) { |
64 | | - $block = new Block(); |
| 64 | + $block = new Block; |
65 | 65 | $block->load( $address, $user, $killExpired ); |
66 | 66 | if ( $block->isValid() ) { |
67 | 67 | return $block; |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | $dbr = wfGetDB( DB_SLAVE ); |
81 | 81 | $res = $dbr->resultObject( $dbr->select( 'ipblocks', '*', |
82 | 82 | array( 'ipb_id' => $id ), __METHOD__ ) ); |
83 | | - $block = new Block(); |
| 83 | + $block = new Block; |
84 | 84 | if ( $block->loadFromResult( $res ) ) { |
85 | 85 | return $block; |
86 | 86 | } else { |
— | — | @@ -162,8 +162,9 @@ |
163 | 163 | if ( $user && $this->mAnonOnly ) { |
164 | 164 | # Block is marked anon-only |
165 | 165 | # Whitelist this IP address against autoblocks and range blocks |
| 166 | + # (but not account creation blocks -- bug 13611) |
166 | 167 | if( !$this->mCreateAccount ) { |
167 | | - $this->clear(); // bug 13611 - keep this data |
| 168 | + $this->clear(); |
168 | 169 | } |
169 | 170 | return false; |
170 | 171 | } else { |
— | — | @@ -175,8 +176,9 @@ |
176 | 177 | # Try range block |
177 | 178 | if ( $this->loadRange( $address, $killExpired, $user ) ) { |
178 | 179 | if ( $user && $this->mAnonOnly ) { |
| 180 | + # Respect account creation blocks on logged-in users -- bug 13611 |
179 | 181 | if( !$this->mCreateAccount ) { |
180 | | - $this->clear(); // bug 13611 - keep this data |
| 182 | + $this->clear(); |
181 | 183 | } |
182 | 184 | return false; |
183 | 185 | } else { |
— | — | @@ -336,7 +338,7 @@ |
337 | 339 | /*static*/ function enumBlocks( $callback, $tag, $flags = 0 ) { |
338 | 340 | global $wgAntiLockFlags; |
339 | 341 | |
340 | | - $block = new Block(); |
| 342 | + $block = new Block; |
341 | 343 | if ( $flags & Block::EB_FOR_UPDATE ) { |
342 | 344 | $db = wfGetDB( DB_MASTER ); |
343 | 345 | if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) { |