r43083 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43082‎ | r43083 | r43084 >
Date:17:17, 2 November 2008
Author:simetrical
Status:old
Tags:
Comment:
Use MediaWiki whitespace standards, please.

This file is really a mess, though. We need a unified system of
functions that will autodetect any IP address format and convert to any
desired format, not this hodgepodge of inconsistently-named and
inconsistently-operating hacks.
Modified paths:
  • /trunk/phase3/includes/IP.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/IP.php
@@ -174,17 +174,16 @@
175175 * @param $ip string Hex IP
176176 * @return string
177177 */
178 - public static function hexToIP($ip)
179 - {
 178+ public static function hexToIP( $ip ) {
180179 // Converts a hexadecimal IP to nnn.nnn.nnn.nnn format
181 - $dec = wfBaseConvert($ip, 16, 10);
 180+ $dec = wfBaseConvert( $ip, 16, 10 );
182181 $parts[3] = $dec % 256;
183182 $dec /= 256;
184183 $parts[2] = $dec % 256;
185184 $dec /= 256;
186185 $parts[1] = $dec % 256;
187186 $parts[0] = $dec / 256;
188 - return implode('.', array_reverse($parts));
 187+ return implode( '.', array_reverse( $parts ) );
189188 }
190189
191190 /**

Status & tagging log