public static function Uncompress($ip)
{
$uip = SimplePie_Net_IPv6::removeNetmaskSpec($ip);
$c1 = -1;
$c2 = -1;
if (strpos($ip, '::') !== false) {
list($ip1, $ip2) = explode('::', $ip);
if ($ip1 === '') {
$c1 = -1;
} else {
$pos = 0;
if (($pos = substr_count($ip1, ':')) > 0) {
$c1 = $pos;
} else {
$c1 = 0;
}
}
if ($ip2 === '') {
$c2 = -1;
} else {
$pos = 0;
if (($pos = substr_count($ip2, ':')) > 0) {
$c2 = $pos;
} else {
$c2 = 0;
}
}
if (strstr($ip2, '.')) {
$c2++;
}
if ($c1 === -1 && $c2 === -1) {
$uip = '0:0:0:0:0:0:0:0';
} else {
if ($c1 === -1) {
$fill = str_repeat('0:', 7 - $c2);
$uip = str_replace('::', $fill, $uip);
} else {
if ($c2 === -1) {
$fill = str_repeat(':0', 7 - $c1);
$uip = str_replace('::', $fill, $uip);
} else {
$fill = str_repeat(':0:', 6 - $c2 - $c1);
$uip = str_replace('::', $fill, $uip);
$uip = str_replace('::', ':', $uip);
}
}
}
}
return $uip;
}