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]); } /**