Skip to content

Commit

Permalink
Casting return of Validation::ip to always be a boolean when filter_v…
Browse files Browse the repository at this point in the history
…ar is used. It used to return the input string which could cause issue with identity checks.
  • Loading branch information
markstory committed Dec 29, 2009
1 parent b89280a commit 93ced3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/validation.php
Expand Up @@ -549,7 +549,7 @@ function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) {
*/
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();
Expand Down

0 comments on commit 93ced3b

Please sign in to comment.