mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Minor adjustment to ip validation variables.
This commit is contained in:
parent
f65e481ebf
commit
557a6343f9
1 changed files with 4 additions and 4 deletions
|
@ -432,14 +432,14 @@ class Validation {
|
|||
*/
|
||||
public function ip($check, $type = 'both') {
|
||||
$type = strtolower($type);
|
||||
$filterFlags = array();
|
||||
$flags = array();
|
||||
if ($type === 'ipv4' || $type === 'both') {
|
||||
$filterFlags[] = FILTER_FLAG_IPV4;
|
||||
$flags[] = FILTER_FLAG_IPV4;
|
||||
}
|
||||
if ($type === 'ipv6' || $type === 'both') {
|
||||
$filterFlags[] = FILTER_FLAG_IPV6;
|
||||
$flags[] = FILTER_FLAG_IPV6;
|
||||
}
|
||||
return (boolean)filter_var($check, FILTER_VALIDATE_IP, array('flags' => $filterFlags));
|
||||
return (boolean)filter_var($check, FILTER_VALIDATE_IP, array('flags' => $flags));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue