From 49d932b179a6660e8a913b1c8c49dc90eaeeb5d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 21 Sep 2023 12:39:26 +0200 Subject: [PATCH] Clear the `package_server_auth_code` when clearing license data --- .../lib/acp/form/LicenseEditForm.class.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php index 987f7fa7c9..c2ccd8b28e 100644 --- a/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LicenseEditForm.class.php @@ -242,16 +242,21 @@ final class LicenseEditForm extends AbstractFormBuilderForm $optionData = [ Option::getOptionByName('package_server_auth_code')->optionID => $this->apiResponse['license']['authCode'], ]; - $objectAction = new OptionAction( - [], - 'updateAll', - [ - 'data' => $optionData, - ] - ); - $objectAction->executeAction(); + } else { + $optionData = [ + Option::getOptionByName('package_server_auth_code')->optionID => '', + ]; } + $objectAction = new OptionAction( + [], + 'updateAll', + [ + 'data' => $optionData, + ] + ); + $objectAction->executeAction(); + $this->saved(); if (isset($this->url)) { -- 2.20.1