Revert "Update jQuery UI to 1.11.0, GeoIPv6 and IP library"

This reverts commit dca7570b32.
This commit is contained in:
czaks 2014-07-06 03:50:16 +02:00
parent 4881575b39
commit 4a0c87c7e1
9 changed files with 584 additions and 1757 deletions

View file

@ -254,31 +254,13 @@ class CIDR
* and the starting IP is not on a valid network boundrary (eg: Displaying
* an IP from an interface).
*
* <b>Note: The CIDR block returned is NOT always bit aligned.</b>
*
* @return string IP in CIDR notation "start_ip/prefix"
* @return string IP in CIDR notation "ipaddr/prefix"
*/
public function getCidr()
{
return $this->start . '/' . $this->prefix;
}
/**
* Get the TRUE cidr notation for the subnet block.
*
* This is useful for when you want a string representation of the IP/prefix
* and the starting IP is not on a valid network boundrary (eg: Displaying
* an IP from an interface).
*
* <b>Note: The CIDR block returned is ALWAYS bit aligned.</b>
*
* @return string IP in CIDR notation "network/prefix"
*/
public function getTrueCidr()
{
return $this->getNetwork() . '/' . $this->prefix;
}
/**
* Get the [low,high] range of the CIDR block
*
@ -400,9 +382,8 @@ class CIDR
{
// use fixed length HEX strings so we can easily do STRING comparisons
// instead of using slower bccomp() math.
$map = function($v){ return sprintf("%032s", IP::inet_ptoh($v)); };
list($lo,$hi) = array_map($map, CIDR::cidr_to_range($ip));
list($min,$max) = array_map($map, CIDR::cidr_to_range($cidr));
list($lo,$hi) = array_map(function($v){ return sprintf("%032s", IP::inet_ptoh($v)); }, CIDR::cidr_to_range($ip));
list($min,$max) = array_map(function($v){ return sprintf("%032s", IP::inet_ptoh($v)); }, CIDR::cidr_to_range($cidr));
/** visualization of logic used below
lo-hi = $ip to check
@ -466,8 +447,7 @@ class CIDR
}
// force bit length to 32 or 128 depending on type of IP
$version = IP::isIPv4($ip) ? 4 : 6;
$bitlen = $version == 4 ? 32 : 128;
$bitlen = (false === filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ? 128 : 32;
if ($bits === null) {
// if no prefix is given use the length of the binary string which
@ -489,7 +469,7 @@ class CIDR
// calculate "broadcast" (not technically a broadcast in IPv6)
$ip2 = BC::bcor($ip1, BC::bcnot($netmask));
return array(IP::inet_dtop($ip1, $version), IP::inet_dtop($ip2, $version));
return array(IP::inet_dtop($ip1), IP::inet_dtop($ip2));
}
/**