Before, when $activation_date_string was false, the $activation_date would be set to todays' date through new DateTime( false ). But now, setTime() is called on the result of DateTimeImmutable::createFromFormat( 'Y-m-d', false ) which is false and results in a fatal error.
I'm getting an error when trying to publish a new subscription:
The underlying error message is:
This seems to be caused by changes in
/includes/post.php
last week:https://github.com/pronamic/wp-orbis-subscriptions/commit/ba5420c760fcdb4198061c92982b539370190c41#diff-c598a688002b8ecbcb8e530b9dda652939e6382f0fa507627b838b24784c611d
Before, when
$activation_date_string
wasfalse
, the$activation_date
would be set to todays' date throughnew DateTime( false )
. But now,setTime()
is called on the result ofDateTimeImmutable::createFromFormat( 'Y-m-d', false )
which isfalse
and results in a fatal error.PHP debug
```php var_dump( new DateTime( false ) ); var_dump( DateTimeImmutable::createFromFormat( 'Y-m-d', false )->setTime( 0, 0 ) ); ```