Use MediaWiki whitespace standards, please.
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 2 Nov 2008 17:17:19 +0000 (17:17 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 2 Nov 2008 17:17:19 +0000 (17:17 +0000)
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.

includes/IP.php

index b9dfb73..b1d94fd 100644 (file)
@@ -174,17 +174,16 @@ class IP {
         * @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 ) );
        }
 
        /**