[-] Core: Fix isDate validator
This commit is contained in:
@@ -472,9 +472,9 @@ class ValidateCore
|
|||||||
*/
|
*/
|
||||||
public static function isDate($date)
|
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 false;
|
||||||
return checkdate((int)$matches[2], (int)$matches[5], (int)$matches[0]);
|
return checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user