Merge branch 'trunk' into pcp-697-separate-gateway

This commit is contained in:
Alex P 2022-07-26 15:28:27 +03:00
commit e55e2d9c81
5 changed files with 59 additions and 12 deletions

View file

@ -22,7 +22,7 @@ use WC_Product_Variation;
class PayUponInvoiceHelper {
/**
* Ensures date is valid and at least 18 years back.
* Ensures date is valid, at least 18 years back and not older than 100 years.
*
* @param string $date The date.
* @param string $format The date format.
@ -43,6 +43,10 @@ class PayUponInvoiceHelper {
return false;
}
if ( $date_time < strtotime( '-100 years', time() ) ) {
return false;
}
return true;
}