jenkins-bot has submitted this change and it was merged.

Change subject: Remove duplicate code in SpecialGlobalBlockList
......................................................................


Remove duplicate code in SpecialGlobalBlockList

Change-Id: I32aaf39b778cec2a19c63193d5ec0b7cb053ebc1
---
M includes/specials/SpecialGlobalBlockList.php
1 file changed, 1 insertion(+), 9 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialGlobalBlockList.php 
b/includes/specials/SpecialGlobalBlockList.php
index 197b65b..a43aa2d 100644
--- a/includes/specials/SpecialGlobalBlockList.php
+++ b/includes/specials/SpecialGlobalBlockList.php
@@ -79,15 +79,7 @@
                                $conds = array( 'gb_address' => $ip );
                        } else {
                                // They searched for an IP. Match any range 
covering that IP
-                               $hex_ip = IP::toHex( $ip );
-                               $ip_pattern = substr( $hex_ip, 0, 4 ) . '%'; // 
Don't bother checking blocks out of this /16.
-
-                               $dbr = wfGetDB( DB_SLAVE );
-
-                               $conds = array( 'gb_range_end>=' . 
$dbr->addQuotes( $hex_ip ), // This block in the given range.
-                                       'gb_range_start<=' . $dbr->addQuotes( 
$hex_ip ),
-                                       'gb_range_start like ' . 
$dbr->addQuotes( $ip_pattern ),
-                                       'gb_expiry>' . $dbr->addQuotes( 
$dbr->timestamp( wfTimestampNow() ) ) );
+                               $conds = GlobalBlocking::getRangeCondition( $ip 
);
                        }
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/211110
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I32aaf39b778cec2a19c63193d5ec0b7cb053ebc1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalBlocking
Gerrit-Branch: master
Gerrit-Owner: Glaisher <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to