r43082 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43081‎ | r43082 | r43083 >
Date:16:52, 2 November 2008
Author:catrope
Status:old
Tags:
Comment:
Followup on r43081: GlobalBlocking too
Modified paths:
  • /trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php
@@ -129,26 +129,14 @@
130130 $block['reason'] = $row->gb_reason;
131131 if($fld_range)
132132 {
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);
135135 }
136136 $data[] = $block;
137137 }
138138 $result->setIndexedTagName($data, 'block');
139139 $result->addValue('query', $this->getModuleName(), $data);
140140 }
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 - }
153141
154142 public function getAllowedParams() {
155143 return array (

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43081API: Move ApiQueryBlocks::convertHexIP() to IP::hexToIP() per Werdna's commen...catrope16:50, 2 November 2008

Status & tagging log