diff options
author | Christian Schneider | 2019-09-02 17:14:43 +0200 |
---|---|---|
committer | Christian Schneider | 2019-09-02 17:14:43 +0200 |
commit | 2b13737e9299317c865f72f4a276ea0b733c4f5f (patch) | |
tree | b800cc0e889d976ba0957e168df45622aee24ee2 /it.class | |
parent | b422951038a66713c18ec4d24ce71a13dd0756a6 (diff) | |
download | itools-2b13737e9299317c865f72f4a276ea0b733c4f5f.tar.gz itools-2b13737e9299317c865f72f4a276ea0b733c4f5f.tar.bz2 itools-2b13737e9299317c865f72f4a276ea0b733c4f5f.zip |
Make itools a bit stricter, new PHP versions start to enforce more declarations
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -372,7 +372,7 @@ static function toascii($text) * @param $cidrs IP range in CIDR notation (192.168.42.64/26) or array of ranges * @return true if $ip is within $cidr */ -function cidr_match($ip, $cidrs) +static function cidr_match($ip, $cidrs) { foreach ((array)$cidrs as $cidr) { @@ -381,7 +381,7 @@ function cidr_match($ip, $cidrs) $subnet_bin = inet_pton($subnet); $valid_bytes = $mask ? $mask >> 3 : 42; $bitmask = 256 - (1 << (8 - ($mask & 7))); - $lastbyte_matched = $bitmask ? (ord($ip_bin{$valid_bytes}) & $bitmask) == (ord($subnet_bin{$valid_bytes}) & $bitmask) : true; + $lastbyte_matched = $bitmask ? (ord($ip_bin[$valid_bytes]) & $bitmask) == (ord($subnet_bin[$valid_bytes]) & $bitmask) : true; if (substr($ip_bin, 0, $valid_bytes) == substr($subnet_bin, 0, $valid_bytes) && $lastbyte_matched) return true; |