From 93ced3be4650b83a11291a1fed81a95ee0feea9c Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 29 Dec 2009 11:04:58 -0500 Subject: [PATCH] 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. --- cake/libs/validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index f90a3a8d3..88a641d1b 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -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();