From 28772d7e2d306b97a654873bb8a0f989663f886a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 12 Mar 2007 21:56:31 +0000 Subject: [PATCH] *Get range blocks to consider "anononly" while I'm at it --- includes/Block.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index e35ead82d1..89764ce472 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -147,7 +147,7 @@ class Block } # Try range block - if ( $this->loadRange( $address, $killExpired, $user == 0 ) ) { + if ( $this->loadRange( $address, $killExpired, $user ) ) { if ( $user && $this->mAnonOnly ) { $this->clear(); return false; @@ -212,7 +212,7 @@ class Block * Search the database for any range blocks matching the given address, and * load the row if one is found. */ - function loadRange( $address, $killExpired = true ) + function loadRange( $address, $killExpired = true, $user = 0 ) { $iaddr = IP::toHex( $address ); if ( $iaddr === false ) { @@ -231,6 +231,10 @@ class Block "ipb_range_start <= '$iaddr'", "ipb_range_end >= '$iaddr'" ); + + if ( $user ) { + $conds['ipb_anon_only'] = 0; + } $res = $db->resultObject( $db->select( 'ipblocks', '*', $conds, __METHOD__, $options ) ); $success = $this->loadFromResult( $res, $killExpired ); -- 2.20.1