mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Casting return of Validation::ip to always be a boolean when filter_var is used. It used to return the input string which could cause issue with identity checks.
This commit is contained in:
parent
b89280a916
commit
93ced3be46
1 changed files with 1 additions and 1 deletions
|
@ -549,7 +549,7 @@ class Validation extends Object {
|
|||
*/
|
||||
function ip($check, $type = 'IPv4') {
|
||||
if (function_exists('filter_var')) {
|
||||
return filter_var($check, FILTER_VALIDATE_IP);
|
||||
return (boolean) filter_var($check, FILTER_VALIDATE_IP);
|
||||
}
|
||||
|
||||
$_this =& Validation::getInstance();
|
||||
|
|
Loading…
Add table
Reference in a new issue