From 35cd588ea425c0bd1bb377a314cacf8f67f6b1c1 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Fri, 12 Apr 2024 10:14:28 -0400 Subject: [PATCH 1/2] Fix PHP 8 error: gmmktime(): Argument #4 ($month) must be of type ?int, string --- includes/functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 4141d9631..8dd9c6000 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -821,14 +821,14 @@ function date_to_epoch( $d, $gmt = true ) { if ( $gmt ) return gmmktime ( $dH, $di, $ds, - substr ( $d, 4, 2 ), - substr ( $d, 6, 2 ), - substr ( $d, 0, 4 ) ); + (int)substr ( $d, 4, 2 ), + (int)substr ( $d, 6, 2 ), + (int)substr ( $d, 0, 4 ) ); else return mktime ( $dH, $di, $ds, - substr ( $d, 4, 2 ), - substr ( $d, 6, 2 ), - substr ( $d, 0, 4 ) ); + (int)substr ( $d, 4, 2 ), + (int)substr ( $d, 6, 2 ), + (int)substr ( $d, 0, 4 ) ); } From 48cb0cf220083dc82e448b68d10cca3bcf69f537 Mon Sep 17 00:00:00 2001 From: Craig Knudsen Date: Fri, 12 Apr 2024 11:22:44 -0400 Subject: [PATCH 2/2] Fix PHP 8 error: Cannot assign null to property Event::$_dueDate --- includes/classes/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/classes/Event.php b/includes/classes/Event.php index 994ed8140..e24ebe64d 100644 --- a/includes/classes/Event.php +++ b/includes/classes/Event.php @@ -202,7 +202,7 @@ function __construct ( $name, $description, $date, $time, $id, $extForID, $this->_calType = $calType; $this->_location = $location; $this->_url = $url; - $this->_dueDate = $dueDate; + $this->_dueDate = empty($dueDate) ? '' : $dueDate; $this->_dueTime = sprintf ( "%06d", $dueTime ); $this->_due = $dueDate . sprintf ( "%06d", $dueTime ); $this->_percent = $percent;