Skip to content

Commit

Permalink
Fixed issue #18963: On PHP 8.2 new DateTime() can not be invoked with…
Browse files Browse the repository at this point in the history
… null (#3291)
  • Loading branch information
weberhofer committed Jul 21, 2023
1 parent 5a08c33 commit 7ae2b78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/models/Survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,8 @@ public function getState()

// Time comparison
$oNow = new DateTime($sNow);
$oStop = new DateTime($sStop);
$oStart = new DateTime($sStart);
$oStop = empty($sStop) ? null : new DateTime($sStop);
$oStart = empty($sStart) ? null : new DateTime($sStart);

$bExpired = (!is_null($sStop) && $oStop < $oNow);
$bWillRun = (!is_null($sStart) && $oStart > $oNow);
Expand Down

0 comments on commit 7ae2b78

Please sign in to comment.