From e7609469d4bff15db0847c2393b18e520e32583c Mon Sep 17 00:00:00 2001 From: DarkAngelBGE Date: Mon, 5 May 2008 14:21:05 +0000 Subject: [PATCH] refactoring Validation::ip() git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6755 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/validation.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index a2eb864f1..6e6714ee3 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -530,13 +530,12 @@ class Validation extends Object { function ip($check) { $bytes = explode('.', $check); if (count($bytes) == 4) { - $returnValue = true; foreach ($bytes as $byte) { if (!(is_numeric($byte) && $byte >= 0 && $byte <= 255)) { - $returnValue = false; + return false; } } - return $returnValue; + return true; } return false; }