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.
* @param $ip string Hex IP
* @return string
*/
- public static function hexToIP($ip)
- {
+ public static function hexToIP( $ip ) {
// Converts a hexadecimal IP to nnn.nnn.nnn.nnn format
- $dec = wfBaseConvert($ip, 16, 10);
+ $dec = wfBaseConvert( $ip, 16, 10 );
$parts[3] = $dec % 256;
$dec /= 256;
$parts[2] = $dec % 256;
$dec /= 256;
$parts[1] = $dec % 256;
$parts[0] = $dec / 256;
- return implode('.', array_reverse($parts));
+ return implode( '.', array_reverse( $parts ) );
}
/**