Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.6
-
Fix Version/s: 4.4.0
-
Component/s: CiviCRM API
-
Labels:None
Description
Jan 1st 1970 happens to have unix timestamp 0, so the check for date validity fails on it.
in api/v3/utils.php:
if (strtotime($params[$fieldInfo['name']]) == 0)
throw new Exception($fieldInfo['name'] . " is not a valid date: " . $params[$fieldInfo['name']]);
(this logic is used twice in the file)
the verification should be for strtotime() === FALSE
See: http://php.net/manual/en/function.strtotime.php