Index: trunk/phase3/includes/Block.php |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | } |
149 | 149 | |
150 | 150 | # Try range block |
151 | | - if ( $this->loadRange( $address, $killExpired, $user == 0 ) ) { |
| 151 | + if ( $this->loadRange( $address, $killExpired, $user ) ) { |
152 | 152 | if ( $user && $this->mAnonOnly ) { |
153 | 153 | $this->clear(); |
154 | 154 | return false; |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | * Search the database for any range blocks matching the given address, and |
214 | 214 | * load the row if one is found. |
215 | 215 | */ |
216 | | - function loadRange( $address, $killExpired = true ) |
| 216 | + function loadRange( $address, $killExpired = true, $user = 0 ) |
217 | 217 | { |
218 | 218 | $iaddr = IP::toHex( $address ); |
219 | 219 | if ( $iaddr === false ) { |
— | — | @@ -231,6 +231,10 @@ |
232 | 232 | "ipb_range_start <= '$iaddr'", |
233 | 233 | "ipb_range_end >= '$iaddr'" |
234 | 234 | ); |
| 235 | + |
| 236 | + if ( $user ) { |
| 237 | + $conds['ipb_anon_only'] = 0; |
| 238 | + } |
235 | 239 | |
236 | 240 | $res = $db->resultObject( $db->select( 'ipblocks', '*', $conds, __METHOD__, $options ) ); |
237 | 241 | $success = $this->loadFromResult( $res, $killExpired ); |