Commit e5040060 by Scott

Fix incorrect regex in ipv6_expand

parent 7629d5ff
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
$ip=ipv6_expand($ip); $ip=ipv6_expand($ip);
$blockipclause=ipv6_expand($blockipclause); $blockipclause=ipv6_expand($blockipclause);
} }
return preg_match('/^'.str_replace('\\*', '[0-9a-fA-F]+', preg_quote($blockipclause, '/')).'$/', $ip) > 0; return preg_match('/^'.str_replace('\\*', '([0-9A-Fa-f]+)', preg_quote($blockipclause, '/')).'$/', $ip) > 0;
// preg_quote misses hyphens but that is OK here // preg_quote misses hyphens but that is OK here
} }
} }
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
} }
$hex = unpack("H*hex", @inet_pton($ip)); $hex = unpack("H*hex", @inet_pton($ip));
$ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1); $ip = substr(preg_replace("/([0-9A-Fa-f]{4})/", "$1:", $hex['hex']), 0, -1);
if($ipv6_wildcard){ if($ipv6_wildcard){
$wildcards = explode(":", $ip); $wildcards = explode(":", $ip);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment