r43039 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43038‎ | r43039 | r43040 >
Date:22:19, 1 November 2008
Author:catrope
Status:old
Tags:
Comment:
API: Followup on r43014: clean up some more
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryBlocks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryBlocks.php
@@ -148,8 +148,8 @@
149149 $block['reason'] = $row->ipb_reason;
150150 if($fld_range)
151151 {
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);
154154 }
155155 if($fld_flags)
156156 {
@@ -185,7 +185,7 @@
186186 $this->usernames[] = $name;
187187 }
188188
189 - protected function convertHexIP($ip)
 189+ protected static function convertHexIP($ip)
190190 {
191191 // Converts a hexadecimal IP to nnn.nnn.nnn.nnn format
192192 $dec = wfBaseConvert($ip, 16, 10);
@@ -194,8 +194,7 @@
195195 $parts[2] = $dec % 256;
196196 $dec /= 256;
197197 $parts[1] = $dec % 256;
198 - $dec /= 256;
199 - $parts[0] = $dec % 256;
 198+ $parts[0] = $dec / 256;
200199 return implode('.', array_reverse($parts));
201200 }
202201

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r43014API: Clean up ApiQueryBlocks, which was a stylistic mess. I can't believe I a...catrope19:23, 1 November 2008

Status & tagging log