Index: trunk/phase3/includes/api/ApiQueryBlocks.php |
— | — | @@ -148,8 +148,8 @@ |
149 | 149 | $block['reason'] = $row->ipb_reason; |
150 | 150 | if($fld_range) |
151 | 151 | { |
152 | | - $block['rangestart'] = $this->convertHexIP($row->ipb_range_start); |
153 | | - $block['rangeend'] = $this->convertHexIP($row->ipb_range_end); |
| 152 | + $block['rangestart'] = self::convertHexIP($row->ipb_range_start); |
| 153 | + $block['rangeend'] = self::convertHexIP($row->ipb_range_end); |
154 | 154 | } |
155 | 155 | if($fld_flags) |
156 | 156 | { |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | $this->usernames[] = $name; |
187 | 187 | } |
188 | 188 | |
189 | | - protected function convertHexIP($ip) |
| 189 | + protected static function convertHexIP($ip) |
190 | 190 | { |
191 | 191 | // Converts a hexadecimal IP to nnn.nnn.nnn.nnn format |
192 | 192 | $dec = wfBaseConvert($ip, 16, 10); |
— | — | @@ -194,8 +194,7 @@ |
195 | 195 | $parts[2] = $dec % 256; |
196 | 196 | $dec /= 256; |
197 | 197 | $parts[1] = $dec % 256; |
198 | | - $dec /= 256; |
199 | | - $parts[0] = $dec % 256; |
| 198 | + $parts[0] = $dec / 256; |
200 | 199 | return implode('.', array_reverse($parts)); |
201 | 200 | } |
202 | 201 | |