Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11353

Date 1970-01-01 not accepted through API

    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

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              rares Rares P
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: