Fixed: IPv6 is not properly processed

This commit is contained in:
NekoCareLab
2025-03-16 14:23:58 +08:00
parent 3ccebfcff1
commit e10d10e4f1
3 changed files with 30 additions and 10 deletions

View File

@@ -72,6 +72,14 @@ class Helper
return $str;
}
public static function wrapIPv6($addr) {
if (filter_var($addr, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
return "[$addr]";
} else {
return $addr;
}
}
public static function multiPasswordVerify($algo, $salt, $password, $hash)
{
switch($algo) {