Permalink
Browse files

Casting return of Validation::ip to always be a boolean when filter_v…

…ar is used. It used to return the input string which could cause issue with identity checks.
  • Loading branch information...
1 parent b89280a commit 93ced3be4650b83a11291a1fed81a95ee0feea9c @markstory markstory committed Dec 29, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 cake/libs/validation.php
View
@@ -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();

0 comments on commit 93ced3b

Please sign in to comment.