From: cajus Date: Tue, 19 Jan 2010 15:16:43 +0000 (+0000) Subject: Made is_date be more correct X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f48047e321971bc8c4b5e1ff7a091769e6376c90;p=gosa.git Made is_date be more correct git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15209 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/utils/class_tests.inc b/gosa-core/include/utils/class_tests.inc index cfd7f255b..6ceba9b13 100644 --- a/gosa-core/include/utils/class_tests.inc +++ b/gosa-core/include/utils/class_tests.inc @@ -258,7 +258,11 @@ class tests { } #TODO: use $lang to check date format - return preg_match("/[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4}/", $date); + if (!preg_match("/([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{4})/", $date, $matches)) { + return false; + } + + return checkdate($matches[1],$matches[2],$matches[3]); } /* Check if the specified IP address $address is inside the given network */