From 0ea1d6ea9ce596ed448893628a19b0b30bb5c4b3 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 1 Nov 2008 22:19:39 +0000 Subject: [PATCH] API: Followup on r43014: clean up some more --- includes/api/ApiQueryBlocks.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index c26beba26e..b888b66cc5 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -148,8 +148,8 @@ class ApiQueryBlocks extends ApiQueryBase { $block['reason'] = $row->ipb_reason; if($fld_range) { - $block['rangestart'] = $this->convertHexIP($row->ipb_range_start); - $block['rangeend'] = $this->convertHexIP($row->ipb_range_end); + $block['rangestart'] = self::convertHexIP($row->ipb_range_start); + $block['rangeend'] = self::convertHexIP($row->ipb_range_end); } if($fld_flags) { @@ -185,7 +185,7 @@ class ApiQueryBlocks extends ApiQueryBase { $this->usernames[] = $name; } - protected function convertHexIP($ip) + protected static function convertHexIP($ip) { // Converts a hexadecimal IP to nnn.nnn.nnn.nnn format $dec = wfBaseConvert($ip, 16, 10); @@ -194,8 +194,7 @@ class ApiQueryBlocks extends ApiQueryBase { $parts[2] = $dec % 256; $dec /= 256; $parts[1] = $dec % 256; - $dec /= 256; - $parts[0] = $dec % 256; + $parts[0] = $dec / 256; return implode('.', array_reverse($parts)); } -- 2.20.1