r43089 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43088‎ | r43089 | r43090 >
Date:18:35, 2 November 2008
Author:aaron
Status:old
Tags:
Comment:
* Fix comment
* Rename HexToIP -> HexToQuad
Modified paths:
  • /trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php (modified) (history)
  • /trunk/phase3/includes/IP.php (modified) (history)
  • /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'] = IP::hexToIP($row->ipb_range_start);
153 - $block['rangeend'] = IP::hexToIP($row->ipb_range_end);
 152+ $block['rangestart'] = IP::hexToQuad($row->ipb_range_start);
 153+ $block['rangeend'] = IP::hexToQuad($row->ipb_range_end);
154154 }
155155 if($fld_flags)
156156 {
Index: trunk/phase3/includes/IP.php
@@ -152,7 +152,7 @@
153153 }
154154
155155 /**
156 - * Given an unsigned integer, returns an IPv6 address in octet notation
 156+ * Given a hexadecimal number, returns to an IPv6 address in octet notation
157157 * @param $ip string hex IP
158158 * @return string
159159 */
@@ -174,7 +174,7 @@
175175 * @param $ip string Hex IP
176176 * @return string
177177 */
178 - public static function hexToIP( $ip ) {
 178+ public static function hexToQuad( $ip ) {
179179 // Converts a hexadecimal IP to nnn.nnn.nnn.nnn format
180180 $dec = wfBaseConvert( $ip, 16, 10 );
181181 $parts[3] = $dec % 256;
Index: trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php
@@ -129,8 +129,8 @@
130130 $block['reason'] = $row->gb_reason;
131131 if($fld_range)
132132 {
133 - $block['rangestart'] = IP::hexToIP($row->gb_range_start);
134 - $block['rangeend'] = IP::hexToIP($row->gb_range_end);
 133+ $block['rangestart'] = IP::hexToQuad($row->gb_range_start);
 134+ $block['rangeend'] = IP::hexToQuad($row->gb_range_end);
135135 }
136136 $data[] = $block;
137137 }

Status & tagging log