Skip to content
This repository
Browse code

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...
commit 93ced3be4650b83a11291a1fed81a95ee0feea9c 1 parent b89280a
Mark Story authored December 29, 2009

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  cake/libs/validation.php
2  cake/libs/validation.php
@@ -549,7 +549,7 @@ function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) {
549 549
  */
550 550
 	function ip($check, $type = 'IPv4') {
551 551
 		if (function_exists('filter_var')) {
552  
-			return filter_var($check, FILTER_VALIDATE_IP);
  552
+			return (boolean) filter_var($check, FILTER_VALIDATE_IP);
553 553
 		}
554 554
 
555 555
 		$_this =& Validation::getInstance();

0 notes on commit 93ced3b

Please sign in to comment.
Something went wrong with that request. Please try again.