From 6ddd3a03bbd912d304736aadaec854085bb52dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 3 Dec 2012 16:52:22 +0100 Subject: [PATCH] [-] Core: Fix isDate validator --- classes/Validate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Validate.php b/classes/Validate.php index 942a0574a..a3e564f1b 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -472,9 +472,9 @@ class ValidateCore */ public static function isDate($date) { - if (!preg_match('/^([0-9]{4})-((0?[0-9])|(1[0-2]))-((0?[0-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches)) + if (!preg_match('/^([0-9]{4})-((?:0?[0-9])|(?:1[0-2]))-((?:0?[0-9])|(?:[1-2][0-9])|(?:3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches)) return false; - return checkdate((int)$matches[2], (int)$matches[5], (int)$matches[0]); + return checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1]); } /**