Commit c478a0dd by Scott

Fix implode usage

Causes deprecation notice on PHP 7.4
parent fa88edfd
...@@ -254,26 +254,26 @@ function qa_ipv6_expand($ip) ...@@ -254,26 +254,26 @@ function qa_ipv6_expand($ip)
$ipv6_wildcard = true; $ipv6_wildcard = true;
} }
if ($ipv6_wildcard) { if ($ipv6_wildcard) {
$wildcards = explode(":", $ip); $wildcards = explode(':', $ip);
foreach ($wildcards as $index => $value) { foreach ($wildcards as $index => $value) {
if ($value == "*") { if ($value == "*") {
$wildcards_matched[] = count($wildcards) - 1 - $index; $wildcards_matched[] = count($wildcards) - 1 - $index;
$wildcards[$index] = "0"; $wildcards[$index] = "0";
} }
} }
$ip = implode($wildcards, ":"); $ip = implode(':', $wildcards);
} }
$hex = unpack("H*hex", @inet_pton($ip)); $hex = unpack("H*hex", @inet_pton($ip));
$ip = substr(preg_replace("/([0-9A-Fa-f]{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);
foreach ($wildcards_matched as $value) { foreach ($wildcards_matched as $value) {
$i = count($wildcards) - 1 - $value; $i = count($wildcards) - 1 - $value;
$wildcards[$i] = "*"; $wildcards[$i] = "*";
} }
$ip = implode($wildcards, ":"); $ip = implode(':', $wildcards);
} }
return $ip; return $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