From e326e68386437737777b2753953099035f22e0d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 27 Sep 2023 16:11:17 +0200 Subject: [PATCH] Handle malformed JSON in LicenseApi::parseLicenseData() --- .../files/lib/system/package/license/LicenseApi.class.php | 3 ++- 1 file changed, 2 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 09a0f085b5..5823bd620c 100644 --- a/wcfsetup/install/files/lib/system/package/license/LicenseApi.class.php +++ b/wcfsetup/install/files/lib/system/package/license/LicenseApi.class.php @@ -3,6 +3,7 @@ namespace wcf\system\package\license; use CuyZ\Valinor\Mapper\MappingError; +use CuyZ\Valinor\Mapper\Source\Exception\InvalidSource; use CuyZ\Valinor\Mapper\Source\Source; use CuyZ\Valinor\MapperBuilder; use GuzzleHttp\Psr7\Request; @@ -52,7 +53,7 @@ final class LicenseApi LicenseData::class, Source::json($json) ); - } catch (MappingError $e) { + } catch (MappingError | InvalidSource $e) { throw new ParsingFailed($e); } } -- 2.20.1