Index: trunk/phase3/includes/IP.php |
— | — | @@ -121,35 +121,6 @@ |
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | | - * Given an IP address in dotted-quad notation, returns an IPv6 octet. |
126 | | - * See http://www.answers.com/topic/ipv4-compatible-address |
127 | | - * IPs with the first 92 bits as zeros are reserved from IPv6 |
128 | | - * @param string $ip quad-dotted IP address. |
129 | | - * @return string IPv4 address |
130 | | - */ |
131 | | - public static function IPv4toIPv6( $ip ) { |
132 | | - if ( !self::isIPv4( $ip ) ) { |
133 | | - throw new MWException( "IPv4toIPv6() called on a non-IPv4 address." ); |
134 | | - } |
135 | | - // IPv4 address with CIDR |
136 | | - if ( strpos( $ip, '/' ) !== false ) { |
137 | | - $parts = explode( '/', $ip, 2 ); |
138 | | - if ( count( $parts ) != 2 ) { |
139 | | - return false; |
140 | | - } |
141 | | - list( $network, $bits ) = $parts; |
142 | | - $network = self::toUnsigned( $network ); |
143 | | - if ( $network !== false && is_numeric( $bits ) && $bits >= 0 && $bits <= 32 ) { |
144 | | - $bits += 96; |
145 | | - return self::toOctet( $network ) . "/$bits"; |
146 | | - } else { |
147 | | - return false; |
148 | | - } |
149 | | - } |
150 | | - return self::toOctet( self::toUnsigned( $ip ) ); |
151 | | - } |
152 | | - |
153 | | - /** |
154 | 125 | * Convert an IP into a nice standard form. |
155 | 126 | * IPv6 addresses in octet notation are expanded to 8 words. |
156 | 127 | * IPv4 addresses are just trimmed. |