[-] FO : fixed validation of birthdates #PSCFV-5465

This commit is contained in:
dMetzger committed 2012-11-09 13:13:29 +00:00
1 parent 38765f51b9
commit 20ad8912bb
1 file changed
+1 -1
+1 -1
View File
@@ -490,7 +490,7 @@ class ValidateCore
return true; return true;
if (preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date)) if (preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date))
{ {
if ($birth_date[1] >= date('Y') - 9) if ($birth_date[1] > date('Y') || $birth_date[2] > date('m') || $birth_date[3] > date('d'))
return false; return false;
return true; return true;
} }