mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Remote getInstance() from validation protected methods.
This commit is contained in:
parent
1302fba632
commit
485570de24
1 changed files with 10 additions and 12 deletions
|
@ -556,10 +556,10 @@ class Validation extends Object {
|
||||||
function ip($check, $type = 'both') {
|
function ip($check, $type = 'both') {
|
||||||
$_this =& Validation::getInstance();
|
$_this =& Validation::getInstance();
|
||||||
$success = false;
|
$success = false;
|
||||||
if ($type === 'IPv4' || $type === 'both') {
|
if ($type === 'ipv4' || $type === 'both') {
|
||||||
$success |= $_this->_ipv4($check);
|
$success |= $_this->_ipv4($check);
|
||||||
}
|
}
|
||||||
if ($type === 'IPv6' || $type === 'both') {
|
if ($type === 'ipv6' || $type === 'both') {
|
||||||
$success |= $_this->_ipv6($check);
|
$success |= $_this->_ipv6($check);
|
||||||
}
|
}
|
||||||
return $success;
|
return $success;
|
||||||
|
@ -576,11 +576,10 @@ class Validation extends Object {
|
||||||
if (function_exists('filter_var')) {
|
if (function_exists('filter_var')) {
|
||||||
return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)) !== false;
|
return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)) !== false;
|
||||||
}
|
}
|
||||||
$_this =& Validation::getInstance();
|
$this->__populateIp();
|
||||||
$_this->__populateIp();
|
$this->check = $check;
|
||||||
$_this->check = $check;
|
$this->regex = '/^' . $this->__pattern['IPv4'] . '$/';
|
||||||
$_this->regex = '/^' . $_this->__pattern['IPv4'] . '$/';
|
return $this->_check();
|
||||||
return $_this->_check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -594,11 +593,10 @@ class Validation extends Object {
|
||||||
if (function_exists('filter_var')) {
|
if (function_exists('filter_var')) {
|
||||||
return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)) !== false;
|
return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)) !== false;
|
||||||
}
|
}
|
||||||
$_this =& Validation::getInstance();
|
$this->__populateIp();
|
||||||
$_this->__populateIp();
|
$this->check = $check;
|
||||||
$_this->check = $check;
|
$this->regex = '/^' . $this->__pattern['IPv6'] . '$/';
|
||||||
$_this->regex = '/^' . $_this->__pattern['IPv6'] . '$/';
|
return $this->_check();
|
||||||
return $_this->_check();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue