From a5ac3888898d709bdd63900dff79b21823477d85 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 15 Mar 2021 10:31:23 +0000 Subject: 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. --- include/datetime.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include/datetime.php') diff --git a/include/datetime.php b/include/datetime.php index 0b8722b4f..4c7105138 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -554,12 +554,16 @@ 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'), + '+' . $durn . ' ' + . str_replace( array(':i',':h',':d',':w',':m',':y'), array('minutes', 'hours', 'days', 'weeks', 'months', 'years'), - ( ':'. $duru ) - ) + ( ':'. $duru ) + ) ) ); return array( 'durn' => $durn, 'duru' => $duru, 'due' => $due); -- cgit v1.2.3