X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FIP.php;h=1e0a4f934545f5ef574fc484d90c06aeb5bcf1d5;hb=5ff7e6fb7a36bfcf76b8cd7083fc5ea720db6b52;hp=72b9a52c8123d863bdbe44161c9760af778b496e;hpb=e0f1be027b69e666ea315cd98795146a55fcabe9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/IP.php b/includes/IP.php index 72b9a52c81..1e0a4f9345 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -33,7 +33,7 @@ define( 'RE_IP_BLOCK', RE_IP_ADD . '\/' . RE_IP_PREFIX ); // An IPv6 address is made up of 8 words (each x0000 to xFFFF). // However, the "::" abbreviation can be used on consecutive x0000 words. define( 'RE_IPV6_WORD', '([0-9A-Fa-f]{1,4})' ); -define( 'RE_IPV6_PREFIX', '(12[0-8]|1[01][0-9]|[1-9]?\d)'); +define( 'RE_IPV6_PREFIX', '(12[0-8]|1[01][0-9]|[1-9]?\d)' ); define( 'RE_IPV6_ADD', '(?:' . // starts with "::" (including "::") ':(?::|(?::' . RE_IPV6_WORD . '){1,7})' . @@ -392,11 +392,11 @@ class IP { static $privateRanges = false; if ( !$privateRanges ) { $privateRanges = array( - array( '10.0.0.0', '10.255.255.255' ), # RFC 1918 (private) - array( '172.16.0.0', '172.31.255.255' ), # " - array( '192.168.0.0', '192.168.255.255' ), # " - array( '0.0.0.0', '0.255.255.255' ), # this network - array( '127.0.0.0', '127.255.255.255' ), # loopback + array( '10.0.0.0', '10.255.255.255' ), # RFC 1918 (private) + array( '172.16.0.0', '172.31.255.255' ), # RFC 1918 (private) + array( '192.168.0.0', '192.168.255.255' ), # RFC 1918 (private) + array( '0.0.0.0', '0.255.255.255' ), # this network + array( '127.0.0.0', '127.255.255.255' ), # loopback ); } @@ -526,7 +526,7 @@ class IP { if ( $bits == 0 ) { $network = 0; } else { - $network &= ~( ( 1 << ( 32 - $bits ) ) - 1); + $network &= ~( ( 1 << ( 32 - $bits ) ) - 1 ); } # Convert to unsigned if ( $network < 0 ) {