From e62ebcd65b42177ee4ac883fd517a13328e9d8db Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 13 Nov 2007 10:47:08 +0000 Subject: [PATCH] removed check_ip() --- lam/lib/account.inc | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 2d900b72..1525086b 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -512,36 +512,5 @@ function get_preg($argument, $regexp) { return false; } -/** - * This function checks if the given IP ist valid. - * - * @param IP - * @param check_subnet true for subnets, else false - * - * @return boolean true or false - **/ -function check_ip($ip, $subnet=false) { - $part = split("[.]", $ip); - // IP must have 4 segments - if (count($part) != 4) { - return false; - } - // non-subnets must not end with 0 - if (!$subnet && ($part[3] < 1)) return false; - // subnets must end with 0 - if ($subnet && ($part[3] != 0)) return false; - for ($i = 0; $i < 3; $i++) { - if (!is_numeric($part[$i])) { - return false; - } - else { - if (($part[$i] > 255) || ($part[$i] < 0)) { - return false; - } - } - } - return true; -} - ?>