mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-16 05:10:15 +00:00
Merge pull request #7633 from mailcow/fix/7501
[Web] Forwarding hosts: store IPv6 addresses in canonical form
This commit is contained in:
1 file changed
+7
@@ -35,6 +35,13 @@ function fwdhost($_action, $_data = null) {
|
|||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$hosts = array_unique(array_map(function ($host) {
|
||||||
|
$net = explode('/', $host, 2);
|
||||||
|
if (filter_var($net[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||||
|
$net[0] = inet_ntop(inet_pton($net[0]));
|
||||||
|
}
|
||||||
|
return implode('/', $net);
|
||||||
|
}, $hosts));
|
||||||
foreach ($hosts as $host) {
|
foreach ($hosts as $host) {
|
||||||
try {
|
try {
|
||||||
$redis->hSet('WHITELISTED_FWD_HOST', $host, $source);
|
$redis->hSet('WHITELISTED_FWD_HOST', $host, $source);
|
||||||
|
|||||||
Reference in new issue
Block a user