mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Also validate IPv6 literals.
This commit is contained in:
parent
bf7f1e5ff8
commit
21b586aa12
@ -425,6 +425,9 @@ function is_ipaddr($ipaddr) {
|
||||
|
||||
/* returns true if $ipaddr is a valid IPv6 address */
|
||||
function is_ipaddrv6($ipaddr) {
|
||||
if(preg_match("/\[([0-9a-f:]+)\]/i", $ipaddr, $match))
|
||||
$ipaddr = $match[1];
|
||||
|
||||
$result = Net_IPv6::checkIPv6($ipaddr);
|
||||
return $result;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user