Index: trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php |
— | — | @@ -129,26 +129,14 @@ |
130 | 130 | $block['reason'] = $row->gb_reason; |
131 | 131 | if($fld_range) |
132 | 132 | { |
133 | | - $block['rangestart'] = self::convertHexIP($row->gb_range_start); |
134 | | - $block['rangeend'] = self::convertHexIP($row->gb_range_end); |
| 133 | + $block['rangestart'] = IP::hexToIP($row->gb_range_start); |
| 134 | + $block['rangeend'] = IP::hexToIP($row->gb_range_end); |
135 | 135 | } |
136 | 136 | $data[] = $block; |
137 | 137 | } |
138 | 138 | $result->setIndexedTagName($data, 'block'); |
139 | 139 | $result->addValue('query', $this->getModuleName(), $data); |
140 | 140 | } |
141 | | - |
142 | | - protected static function convertHexIP($ip) |
143 | | - { |
144 | | - // Converts a hexadecimal IP to nnn.nnn.nnn.nnn format |
145 | | - $dec = wfBaseConvert($ip, 16, 10); |
146 | | - $parts[3] = $dec % 256; |
147 | | - $dec /= 256; |
148 | | - $parts[2] = $dec % 256; |
149 | | - $dec /= 256; |
150 | | - $parts[1] = $dec % 256; |
151 | | - $parts[0] = $dec / 256; |
152 | | - } |
153 | 141 | |
154 | 142 | public function getAllowedParams() { |
155 | 143 | return array ( |