air: fix calculate_adue() to return false if the value is zero and do not hardcode regexpire - adding the max setting (99 years) should be fine.

This commit is contained in:
Mario
2021-03-15 10:31:23 +00:00
parent 4be123dc84
commit a5ac388889
2 changed files with 78 additions and 74 deletions

View File

@@ -306,7 +306,7 @@ class Register extends Controller {
$cfgexpire = get_config('system','register_expire' );
$regexpire = calculate_adue( $cfgexpire );
$regexpire = $regexpire ? $regexpire['due'] : '2099-12-31 23:59:59';
$regexpire = $regexpire ? $regexpire['due'] : datetime_convert('UTC', 'UTC', 'now + 99 years');
// handle an email request that will be verified or an ivitation associated with an email address
if ( $email > '' && ($email_verify || $icdone) ) {

View File

@@ -554,6 +554,10 @@ function update_birthdays() {
if ( preg_match( '/^[0-9]{1,2}[ihdwmy]{1}$/', $duri ) && ($sign == '+' || $sign == '-') ) {
$duru = substr( $duri, -1);
$durn = substr( $duri, 0, -1);
if(!$durn)
return false;
$due = date( 'Y-m-d H:i:s', strtotime(
'+' . $durn . ' '
. str_replace( array(':i',':h',':d',':w',':m',':y'),