From c45c9c0551b301ed1197a9e16012c76716ca6f9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 29 Sep 2023 16:08:01 +0200 Subject: [PATCH] Fix LicenseApi::clearLicenseFile() --- .../files/lib/system/package/license/LicenseApi.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/package/license/LicenseApi.class.php b/wcfsetup/install/files/lib/system/package/license/LicenseApi.class.php index 9d2726db2e..fbc0f0c9a4 100644 --- a/wcfsetup/install/files/lib/system/package/license/LicenseApi.class.php +++ b/wcfsetup/install/files/lib/system/package/license/LicenseApi.class.php @@ -28,8 +28,10 @@ final class LicenseApi public function updateLicenseFile(?LicenseData $data): void { + $creationDate = $data?->creationDate ?? new \DateTimeImmutable(); + $writer = new AtomicWriter(self::LICENSE_FILE); - $writer->write("creationDate->format('c')} */\n\n"); + $writer->write("format('c')} */\n\n"); $writer->write(\sprintf("return unserialize(%s);\n", \var_export(\serialize($data), true))); $writer->flush(); -- 2.20.1