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:
Mark Story 2009-12-29 11:04:58 -05:00
parent b89280a916
commit 93ced3be46

View file

@ -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();