From a34cccd8b1158839e322f379defe74372f3393ec Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 15 Nov 2010 23:20:23 +0000 Subject: [PATCH] Removed weird unused "IPv4toIPv6" function --- includes/IP.php | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/includes/IP.php b/includes/IP.php index 5b4450e659..006e6e5f9f 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -120,35 +120,6 @@ class IP { || preg_match( '/^' . RE_IP_BLOCK . '$/', $ipblock ) ); } - /** - * Given an IP address in dotted-quad notation, returns an IPv6 octet. - * See http://www.answers.com/topic/ipv4-compatible-address - * IPs with the first 92 bits as zeros are reserved from IPv6 - * @param string $ip quad-dotted IP address. - * @return string IPv4 address - */ - public static function IPv4toIPv6( $ip ) { - if ( !self::isIPv4( $ip ) ) { - throw new MWException( "IPv4toIPv6() called on a non-IPv4 address." ); - } - // IPv4 address with CIDR - if ( strpos( $ip, '/' ) !== false ) { - $parts = explode( '/', $ip, 2 ); - if ( count( $parts ) != 2 ) { - return false; - } - list( $network, $bits ) = $parts; - $network = self::toUnsigned( $network ); - if ( $network !== false && is_numeric( $bits ) && $bits >= 0 && $bits <= 32 ) { - $bits += 96; - return self::toOctet( $network ) . "/$bits"; - } else { - return false; - } - } - return self::toOctet( self::toUnsigned( $ip ) ); - } - /** * Convert an IP into a nice standard form. * IPv6 addresses in octet notation are expanded to 8 words. -- 2.20.1