[Web] Expand IPv6 addresses for better comparison

This commit is contained in:
andryyy
2020-05-26 20:04:22 +02:00
parent ad3cd1be02
commit a6af7cbc2e
3 changed files with 13 additions and 9 deletions

View File

@@ -1,12 +1,6 @@
<?php
error_reporting(0);
function expand_ipv6($ip) {
$hex = unpack("H*hex", inet_pton($ip));
$ip = substr(preg_replace("/([A-f0-9]{4})/", "$1:", $hex['hex']), 0, -1);
return $ip;
}
function get_spf_allowed_hosts($check_domain)
{
$hosts = array();