From f48047e321971bc8c4b5e1ff7a091769e6376c90 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 19 Jan 2010 15:16:43 +0000 Subject: [PATCH] Made is_date be more correct git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15209 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/utils/class_tests.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */ -- 2.30.2