Expire the cached license data after 60 days
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 29 Sep 2023 14:25:09 +0000 (16:25 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 29 Sep 2023 14:25:09 +0000 (16:25 +0200)
wcfsetup/install/files/lib/bootstrap/com.woltlab.wcf.php

index f6107400495da889dd628b04dcf556659afb6541..5a3a558ee5cce3720bc7c374f52e930ce6aea9b3 100644 (file)
@@ -77,6 +77,11 @@ return static function (): void {
             if ($brandingFree !== '0.0' && $expiresAt >= \TIME_NOW) {
                 define('WOLTLAB_BRANDING', false);
             }
+
+            // Expire the cached license data after 60 days.
+            if ($licenseData->creationDate->getTimestamp() < \TIME_NOW - 86400 * 60) {
+                $licenseApi->clearLicenseFile();
+            }
         }
     } catch (\Throwable) {
         // Reading the license file must never cause any errors.