Check for correct datetime format on ended_at and cancelled_at date API parameters.
This commit is contained in:
parent
abe78b4883
commit
3c18343722
2 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ function civicrm_api3_twingle_donation_Cancel($params) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Validate date for parameter "cancelled_at".
|
// Validate date for parameter "cancelled_at".
|
||||||
if (!DateTime::createFromFormat('Ymd', $params['cancelled_at'])) {
|
if (!DateTime::createFromFormat('YmdHis', $params['cancelled_at'])) {
|
||||||
throw new CiviCRM_API3_Exception(
|
throw new CiviCRM_API3_Exception(
|
||||||
E::ts('Invalid date for parameter "cancelled_at".'),
|
E::ts('Invalid date for parameter "cancelled_at".'),
|
||||||
'invalid_format'
|
'invalid_format'
|
||||||
|
|
|
@ -65,7 +65,7 @@ function civicrm_api3_twingle_donation_endrecurring($params) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Validate date for parameter "ended_at".
|
// Validate date for parameter "ended_at".
|
||||||
if (!DateTime::createFromFormat('Ymd', $params['ended_at'])) {
|
if (!DateTime::createFromFormat('YmdHis', $params['ended_at'])) {
|
||||||
throw new CiviCRM_API3_Exception(
|
throw new CiviCRM_API3_Exception(
|
||||||
E::ts('Invalid date for parameter "ended_at".'),
|
E::ts('Invalid date for parameter "ended_at".'),
|
||||||
'invalid_format'
|
'invalid_format'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue