From: cajus Date: Fri, 2 Oct 2009 08:42:22 +0000 (+0000) Subject: Updated tests X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=48ee5652dff0158c6d4c92a49c6bc374e60587d6;p=gosa.git Updated tests git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14462 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/utils/class_tests.inc b/gosa-core/include/utils/class_tests.inc index 136dca87a..343163dd1 100644 --- a/gosa-core/include/utils/class_tests.inc +++ b/gosa-core/include/utils/class_tests.inc @@ -231,6 +231,18 @@ class tests { return ($first < $curr&& $last > $curr); } + /* Check if entry value is a valid date */ + public static function is_date($date) + { + global $lang; + + if ($date == ""){ + return (TRUE); + } + + #TODO: use $lang to check date format + return preg_match("/[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}/", $date); + } /* Check if the specified IP address $address is inside the given network */ public static function is_in_ip_range($from, $to, $address)